コード例 #1
0
        public void ADOCanGetAllModels()
        {
            var repo = new ModelsRepositoryADO();

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

            Assert.AreEqual(11, models.Count);
            Assert.AreEqual(8, models[7].ModelId);
            Assert.AreEqual(2, models[7].MakeId);
            Assert.AreEqual("*****@*****.**", models[7].UserName);
            Assert.AreEqual("Transit Connect", models[7].ModelDescription);
            Assert.AreEqual(DateTime.Parse("07/23/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture), models[7].ModelDateAdded);
        }
コード例 #2
0
        public static void ADOCanAddModel()
        {
            Models.Tables.Models modelToAdd = new Models.Tables.Models();
            var repo = new ModelsRepositoryADO();

            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);
        }