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

            // Act&Assert
               Assert.Throws<InvalidUnitCreationCommandException>(() => factory.GetUnit(invalidCommand));
        }
        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);
        }
        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);
        }
 public void GetUnit_WhenInValidCommandIsPassed_ShouldThrowException(string command)
 {
     var unitsFactory = new IntergalacticTravel.UnitsFactory();
     Assert.Throws<InvalidUnitCreationCommandException>(()=>unitsFactory.GetUnit(command));
 }