Пример #1
0
        public void WhenDisposing_MessagesUnsubscribed_AsExpected()
        {
            PlayerSummaryPM systemUnderTest = CreateSystem();

            systemUnderTest.Dispose();

            MockMessenger.Received().RemoveListener(GameMessages.PLAYER_GOLD_CHANGED, Arg.Any <Callback>());
        }
Пример #2
0
        public void WhenCreating_PropertiesSetToExpectedValues()
        {
            MockPlayerManager.Gold.Returns(100);
            MockTreasureManager.GetPlayerTreasureLevel().Returns(11);
            MockTreasureManager.GetPlayerTreasureLevelProgress().Returns(0.5f);

            PlayerSummaryPM systemUnderTest = CreateSystem();

            Assert.AreEqual("100", systemUnderTest.ViewModel.GetPropertyValue <string>(PlayerSummaryPM.GOLD_PROPERTY));
            Assert.AreEqual("11", systemUnderTest.ViewModel.GetPropertyValue <string>(PlayerSummaryPM.TREASURE_LEVEL_PROPERTY));
            Assert.AreEqual(0.5f, systemUnderTest.ViewModel.GetPropertyValue <float>(PlayerSummaryPM.TREASURE_LEVEL_PROGRESS_PROPERTY));
        }
Пример #3
0
        private PlayerSummaryPM CreateSystem()
        {
            PlayerSummaryPM systemUnderTest = new PlayerSummaryPM(MockPlayerManager, MockTreasureManager, MockMessenger);

            return(systemUnderTest);
        }