Example #1
0
        public void SampleDataCanSearchInventoryFourParams()
        {
            var repo  = new InventoryRepositorySampleData();
            var found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MakeModelYear = "C", MinPrice = 20000, MaxPrice = 50000
            });

            Assert.AreEqual(6, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MinPrice = 10000, MaxPrice = 30000, MinYear = 2012
            });
            Assert.AreEqual(6, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MaxPrice = 30000, MinYear = 2012, MaxYear = 2018
            });
            Assert.AreEqual(6, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MakeModelYear = "C", MaxPrice = 20000, MinYear = 2016
            });
            Assert.AreEqual(1, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MakeModelYear = "C", MinYear = 2011, MaxYear = 2015
            });
            Assert.AreEqual(4, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MinPrice = 20000, MinYear = 2011, MaxYear = 2013
            });
            Assert.AreEqual(2, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "Navigator", MinPrice = 20000, MaxPrice = 40000, MinYear = 2018
            });
            Assert.AreEqual(2, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "Navigator", MinPrice = 20000, MinYear = 2018, MaxYear = 2018
            });
            Assert.AreEqual(2, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "Navigator", MinPrice = 10000, MinYear = 2017, MaxYear = 2018
            });
            Assert.AreEqual(2, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinPrice = 30000, MaxPrice = 40000, MinYear = 2010, MaxYear = 2018
            });
            Assert.AreEqual(4, found.Count());
        }
Example #2
0
        public void SampleDataCanSearchInventoryNoParams()
        {
            var repo  = new InventoryRepositorySampleData();
            var found = repo.SearchInventory(new VehicleSearchParameters {
            });

            Assert.AreEqual(20, found.Count());
        }
Example #3
0
        public void SampleDataCanSearchInventoryAllParams()
        {
            var repo  = new InventoryRepositorySampleData();
            var found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MakeModelYear = "T", MinPrice = 20000, MaxPrice = 80000, MinYear = 2010, MaxYear = 2016
            });

            Assert.AreEqual(2, found.Count());
        }
Example #4
0
        public void SampleDataCanSearchInventoryFiveParams()
        {
            var repo  = new InventoryRepositorySampleData();
            var found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MakeModelYear = "E", MinPrice = 30000, MaxPrice = 80000, MinYear = 2010
            });

            Assert.AreEqual(1, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MinPrice = 30000, MaxPrice = 80000, MinYear = 2010, MaxYear = 2015
            });
            Assert.AreEqual(3, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MakeModelYear = "E", MaxPrice = 60000, MinYear = 2010, MaxYear = 2016
            });
            Assert.AreEqual(1, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "Navigator", MinPrice = 30000, MaxPrice = 40000, MinYear = 2018, MaxYear = 2018
            });
            Assert.AreEqual(2, found.Count());
        }
Example #5
0
        public void SampleDataCanSearchInventoryOneParam()
        {
            var repo = new InventoryRepositorySampleData();

            var found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "New"
            });

            Assert.AreEqual(6, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "2017"
            });
            Assert.AreEqual(2, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "C"
            });
            Assert.AreEqual(16, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinPrice = 30000
            });
            Assert.AreEqual(18, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MaxPrice = 35000
            });
            Assert.AreEqual(17, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinYear = 2017
            });
            Assert.AreEqual(7, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MaxYear = 2009
            });
            Assert.AreEqual(12, found.Count());
        }
Example #6
0
        public void SampleDataCanSearchInventoryTwoParams()
        {
            var repo  = new InventoryRepositorySampleData();
            var found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "New", MakeModelYear = "2017"
            });

            Assert.AreEqual(1, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "New", MinPrice = 20000
            });
            Assert.AreEqual(5, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MaxPrice = 34000
            });
            Assert.AreEqual(13, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MinYear = 2005
            });
            Assert.AreEqual(20, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                NewUsed = "Used", MaxYear = 2005
            });
            Assert.AreEqual(7, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "C", MinPrice = 30000
            });
            Assert.AreEqual(7, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "C", MaxPrice = 30000
            });
            Assert.AreEqual(9, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "C", MinYear = 2010
            });
            Assert.AreEqual(9, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MakeModelYear = "C", MaxYear = 2010
            });
            Assert.AreEqual(7, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinYear = 2005, MaxYear = 2016
            });
            Assert.AreEqual(19, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinPrice = 30000, MaxPrice = 50000
            });
            Assert.AreEqual(9, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinPrice = 30000, MinYear = 2010
            });
            Assert.AreEqual(11, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MinPrice = 30000, MaxYear = 2010
            });
            Assert.AreEqual(7, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MaxPrice = 30000, MinYear = 2010
            });
            Assert.AreEqual(9, found.Count());

            found = repo.SearchInventory(new VehicleSearchParameters {
                MaxPrice = 30000, MaxYear = 2010
            });
            Assert.AreEqual(6, found.Count());
        }