Exemplo n.º 1
0
        public void SampleDataCanGetModelsForMake()
        {
            var repo = new ModelsRepositorySampleData();

            var models = repo.GetModelsForMake(3).ToList();

            Assert.AreEqual(3, models.Count);
            Assert.AreEqual(10, models[1].ModelId);
            Assert.AreEqual(3, models[1].MakeId);
            Assert.AreEqual("*****@*****.**", models[1].UserName);
            Assert.AreEqual("MKZ", models[1].ModelDescription);
            Assert.AreEqual(DateTime.Parse("07/23/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture), models[1].ModelDateAdded);
        }
Exemplo n.º 2
0
        public static void SampleDataCanAddModel()
        {
            Models.Tables.Models modelToAdd = new Models.Tables.Models();
            var repo = new ModelsRepositorySampleData();

            modelToAdd.MakeId           = 1;
            modelToAdd.UserId           = "00000000-0000-0000-0000-000000000000";
            modelToAdd.ModelDescription = "Impala";
            modelToAdd.ModelDateAdded   = DateTime.Parse("07/23/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture);

            repo.AddModel(modelToAdd);
            var models = repo.GetAllModels().ToList();

            Assert.IsNotNull(models[11]);
            Assert.AreEqual(12, models.Count);

            Assert.AreEqual(12, models[11].ModelId);
            Assert.AreEqual(1, models[11].MakeId);
            Assert.AreEqual("*****@*****.**", models[11].UserName);
            Assert.AreEqual("Impala", models[11].ModelDescription);
            Assert.AreEqual(DateTime.Parse("07/23/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture), models[10].ModelDateAdded);

            repo.DeleteModel(12);
        }