blob: 94dd0f9a67c7364b658b89ad168dba520cc79c93 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <fuchsia/modular/storymodel/cpp/fidl.h>
#include "gmock/gmock.h" // For EXPECT_THAT and matchers.
#include "gtest/gtest.h"
#include "peridot/bin/sessionmgr/story/model/testing/mutation_matchers.h"
#include "peridot/bin/sessionmgr/story/model/testing/test_mutator.h"
#include "peridot/bin/sessionmgr/story/systems/story_visibility_system.h"
using fuchsia::modular::storymodel::StoryModel;
using fuchsia::modular::storymodel::StoryModelMutation;
namespace modular {
namespace {
class StoryVisibilitySystemTest : public ::testing::Test {
protected:
StoryVisibilitySystemTest() {
auto mutator = std::make_unique<TestMutator>();
mutator_ = mutator.get();
system_ = std::make_unique<StoryVisibilitySystem>(std::move(mutator));
}
std::unique_ptr<StoryVisibilitySystem> system_;
TestMutator* mutator_;
};
TEST_F(StoryVisibilitySystemTest, All) {
system_->RequestStoryVisibilityStateChange(
fuchsia::modular::StoryVisibilityState::IMMERSIVE);
EXPECT_EQ(1lu, mutator_->execute_calls.size());
EXPECT_THAT(mutator_->execute_calls[0].commands,
testing::ElementsAre(IsSetVisibilityMutation(
fuchsia::modular::StoryVisibilityState::IMMERSIVE)));
}
} // namespace
} // namespace modular