Esempio n. 1
0
        public void ActivateFormation_ProvideProperValue_SuccessfullyActivated()
        {
            using (var mock = AutoMock.GetLoose())
            {
                var             name            = "Formation 2";
                BattleFormation battleFormation = new BattleFormation(name);
                var             generalMock     = mock.Create <General>();

                //Act
                battleFormation.ActivateFormation(generalMock);


                //Assert
                Assert.AreEqual(generalMock, battleFormation.GeneralInCharge);
                Assert.IsTrue(battleFormation.IsActive);
            }
        }
Esempio n. 2
0
        public void ActivateFormation_ProvideNullValue_ThrowsException()
        {
            using (var mock = AutoMock.GetLoose())
            {
                //arrange
                var             name            = "Formation 2";
                BattleFormation battleFormation = new BattleFormation(name);
                var             generalMock     = mock.Create <General>();

                //Act

                //Assert

                Assert.Throws <ArgumentNullException>(() => battleFormation.ActivateFormation(null),
                                                      null, "assignedGeneral");
            }
        }