public void GetInRangePrice_Should_Return_Correct_Order() { //Arrange var microsystems = new Microsystems(); var computer = new Computer(7, Brand.DELL, 2400, 15.6, "grey"); var computer2 = new Computer(3, Brand.DELL, 2200, 15.6, "blue"); var computer3 = new Computer(6, Brand.DELL, 2800, 15.6, "grey"); var computer4 = new Computer(5, Brand.ACER, 2500, 15.6, "grey"); //Act microsystems.CreateComputer(computer); microsystems.CreateComputer(computer2); microsystems.CreateComputer(computer3); microsystems.CreateComputer(computer4); var expected = new List <Computer>() { new Computer(5, Brand.ACER, 2500, 15.6, "grey"), new Computer(7, Brand.DELL, 2400, 15.6, "grey"), new Computer(3, Brand.DELL, 2200, 15.6, "blue") }; var actual = microsystems.GetInRangePrice(2200, 2500); //Assert CollectionAssert.AreEqual(expected, actual); }
public void GetInRangePrice_Should_Return_Empty_Collection() { //Arrange var microsystems = new Microsystems(); var computer = new Computer(1, Brand.DELL, 2300, 15.6, "grey"); var computer2 = new Computer(3, Brand.DELL, 2200, 15.6, "grey"); var computer3 = new Computer(4, Brand.DELL, 2800, 15.6, "grey"); var computer4 = new Computer(5, Brand.ACER, 2300, 15.6, "grey"); //Act microsystems.CreateComputer(computer); microsystems.CreateComputer(computer2); microsystems.CreateComputer(computer3); microsystems.CreateComputer(computer4); var expected = Enumerable.Empty <Computer>(); var actual = microsystems.GetInRangePrice(2100, 2199); //Assert CollectionAssert.AreEqual(expected, actual); }
public void GetInRangePrice_Should_Return_Correct_Count() { //Arrange var microsystems = new Microsystems(); var computer = new Computer(1, Brand.DELL, 2300, 15.6, "grey"); var computer2 = new Computer(3, Brand.DELL, 2200, 15.6, "blue"); var computer3 = new Computer(4, Brand.DELL, 2800, 15.6, "grey"); var computer4 = new Computer(5, Brand.ACER, 2300, 15.6, "grey"); //Act microsystems.CreateComputer(computer); microsystems.CreateComputer(computer2); microsystems.CreateComputer(computer3); microsystems.CreateComputer(computer4); var expected = 3; var actual = microsystems.GetInRangePrice(2200, 2300).Count(); //Assert Assert.AreEqual(expected, actual); }