Beispiel #1
0
        public void CanLoadVehicleModels()
        {
            var repo = new VehicleModelRepository();

            var models = repo.GetVehicleModels().ToList();

            Assert.AreEqual(5, models.Count());
            Assert.AreEqual("Explorer", models[0].VehicleModelName);
            Assert.AreEqual(1, models[0].VehicleMakeId);
            Assert.AreEqual("Ram 1500", models[3].VehicleModelName);
            Assert.AreEqual(2, models[1].VehicleMakeId);
        }
Beispiel #2
0
        public void CanInsertVehicleModel()
        {
            var repo = new VehicleModelRepository();

            ModelsItem newModel = new ModelsItem()
            {
                VehicleModelName = "Matrix",
                VehicleMakeId    = 5,
                UserId           = "00000000-0000-0000-0000-000000000000"
            };

            repo.Insert(newModel);

            var allModels = repo.GetVehicleModels().ToList();

            Assert.AreEqual(6, allModels.Count());
            Assert.AreEqual("Matrix", allModels[5].VehicleModelName);
        }