public void GetOutputData_EmptyListStarShips() { IStarShipsOperations swAPI = GetNewFactoryStarWarsAPI(); Assert.That(() => { swAPI.GetOutputData(new List <StarShip>(), 10).ToList(); }, Throws.InstanceOf <StarShipException>()); }
public void GetOutputData_ZeroMGLT() { IList <StarShip> listStarShip = new List <StarShip>() { new StarShip() { name = "1", model = "M1", MGLT = "15" } }; IStarShipsOperations swAPI = GetNewFactoryStarWarsAPI(); Assert.Throws <StarShipException>(() => swAPI.GetOutputData(listStarShip, 0).ToList()); }
public void GetOutputData_ExpectedOutput() { IList <StarShip> listStarShips = new List <StarShip>() { new StarShip() { name = "1", model = "M1", MGLT = "15" }, new StarShip() { name = "2", model = "M2", MGLT = "10" } }; IStarShipsOperations swAPI = GetNewFactoryStarWarsAPI(); IEnumerable <string> outputValues = swAPI.GetOutputData(listStarShips, 15); Assert.AreEqual(outputValues.First(), "1: 1"); Assert.AreEqual(outputValues.Last(), "2: 2"); }
public void GetOutputData_NullListStarShips() { IStarShipsOperations swAPI = GetNewFactoryStarWarsAPI(); Assert.Throws <StarShipException>(() => swAPI.GetOutputData(null, 10).ToList()); }