예제 #1
0
        public void GetUnit_WhenInvalidFormatOfCommandPassed_ShouldThrowInvalidUnitCreationCommandException(string invalidCommand)
        {
            // Arrange
            var factory = new UnitsFactory();

            // Act&Assert
               Assert.Throws<InvalidUnitCreationCommandException>(() => factory.GetUnit(invalidCommand));
        }
예제 #2
0
        public void GetUnit_WhenValidCommandIsPassed_ShouldReturnNewProcyon()
        {
            var unitsFactory = new IntergalacticTravel.UnitsFactory();
            var command = "create unit Procyon Gosho 1";

            var result = unitsFactory.GetUnit(command);

            Assert.IsInstanceOf<Procyon>(result);
        }
예제 #3
0
        public void GetUnit_WhenValidCommandIsPassed_ShouldReturnNewLacaille()
        {
            var unitsFactory = new IntergalacticTravel.UnitsFactory();
            var command = "create unit Lacaille Tosho 3";

            var result = unitsFactory.GetUnit(command);

            Assert.IsInstanceOf<Lacaille>(result);
        }
예제 #4
0
        public void GetUnit_WhenValidCommandIsPassed_ShouldReturnNewProcyonUnit()
        {
            // Arrange
            var validCommand = "create unit Procyon Gosho 1";

            // Act
            var factory = new UnitsFactory();
            var expectedResult = factory.GetUnit(validCommand);

            // Assert
            Assert.IsInstanceOf<Procyon>(expectedResult);
        }
예제 #5
0
        public void GetUnit_WhenValidCommandIsPassed_ShouldReturnNewLacailleUnit()
        {
            // Arrange
            var validCommand = "create unit Lacaille Tosho 3";

            // Act
            var factory = new UnitsFactory();
            var expectedResult = factory.GetUnit(validCommand);

            // Assert
            Assert.IsInstanceOf<Lacaille>(expectedResult);
        }
예제 #6
0
 public void GetUnit_WhenInValidCommandIsPassed_ShouldThrowException(string command)
 {
     var unitsFactory = new IntergalacticTravel.UnitsFactory();
     Assert.Throws<InvalidUnitCreationCommandException>(()=>unitsFactory.GetUnit(command));
 }