示例#1
0
        public void TestAttach_WithUnselectedCore_ShouldReturnFailureMessage()
        {
            ICommand testCommand = new AttachFragmentCommand(
                this.testNuclearPowerPlant,
                FragmentType.Nuclear,
                "Test",
                1);
            String actualMessage = testCommand.Execute();

            String expectedMessage = "Failed to attach Fragment Test!";

            Assert.AreEqual(expectedMessage, actualMessage, "AttachFragment command does not work correctly!");
        }
示例#2
0
        public void TestAttach_WithSelectedCore_ShouldReturnSuccessMessage()
        {
            ICore dummyCore = new SystemCore("A", 100);

            this.testNuclearPowerPlant.AttachCore(dummyCore);
            this.testNuclearPowerPlant.SelectCore("A");

            ICommand testCommand = new AttachFragmentCommand(
                this.testNuclearPowerPlant,
                FragmentType.Nuclear,
                "Test",
                1);
            String actualMessage = testCommand.Execute();

            String expectedMessage = "Successfully attached Fragment Test to Core A!";

            Assert.AreEqual(expectedMessage, actualMessage, "AttachFragment command does not work correctly!");
        }
示例#3
0
        public void TestAttach_WithInvalidPressureAffection_ShouldReturnFailureMessage()
        {
            ICore dummyCore = new SystemCore("A", 100);

            this.testNuclearPowerPlant.AttachCore(dummyCore);
            this.testNuclearPowerPlant.SelectCore("A");

            ICommand testCommand = new AttachFragmentCommand(
                this.testNuclearPowerPlant,
                FragmentType.Nuclear,
                "Test",
                -1);
            String actualMessage = testCommand.Execute();

            String expectedMessage = "Failed to attach Fragment Test!";

            Assert.AreEqual(expectedMessage, actualMessage, "AttachFragment command does not work correctly!");
        }