Example #1
0
        public void DealershipApiFail()
        {
            DealershipsController dealerships = new DealershipsController(_context);

            Dealership testDealership = dealerships.GetDealership(5);

            Assert.IsInstanceOfType(testDealership, typeof(Dealership));

            Assert.IsNull(testDealership);
        }
Example #2
0
        public void DealershipApiPass()
        {
            DealershipsController dealerships = new DealershipsController(_context);

            Dealership testDealership = dealerships.GetDealership(2);

            Assert.IsInstanceOfType(testDealership, typeof(Dealership));

            Assert.AreEqual("Devons Cars", testDealership.Name);
            Assert.AreEqual("365-008-6341", testDealership.Name);
        }
Example #3
0
        public void DealershipApiGetAllTest()
        {
            DealershipsController dealerships = new DealershipsController(_context);

            IEnumerable <Dealership> testDealership = dealerships.GetDealership();

            Assert.IsInstanceOfType(testDealership, typeof(DbSet <Dealership>));

            DbSet <Dealership> testDbDealership = testDealership as DbSet <Dealership>;

            int count = DealershipList.Count;

            Assert.AreEqual(3, count);
        }