예제 #1
0
        public void ADOCanLoadMakes()
        {
            var repo = new MakesRepositoryADO();

            var makes = repo.GetAllMakes().ToList();

            Assert.AreEqual(3, makes.Count);
            Assert.AreEqual(1, makes[0].MakeId);
            Assert.AreEqual("*****@*****.**", makes[0].UserName);
            Assert.AreEqual("Chevrolet", makes[0].MakeDescription);
            Assert.AreEqual(DateTime.Parse("07/22/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture), makes[0].MakeDateAdded);
        }
예제 #2
0
        public static void ADOCanAddMake()
        {
            Makes makeToAdd = new Makes();
            var   repo      = new MakesRepositoryADO();

            makeToAdd.UserId          = "00000000-0000-0000-0000-000000000000";
            makeToAdd.MakeDescription = "FakeMake";
            makeToAdd.MakeDateAdded   = DateTime.Parse("07/22/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture);

            repo.AddMake(makeToAdd);
            var makes = repo.GetAllMakes().ToList();

            Assert.IsNotNull(makes[3]);
            Assert.AreEqual(4, makes.Count);

            Assert.AreEqual(4, makes[3].MakeId);
            Assert.AreEqual("*****@*****.**", makes[3].UserName);
            Assert.AreEqual("FakeMake", makes[3].MakeDescription);
            Assert.AreEqual(DateTime.Parse("07/22/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture), makes[3].MakeDateAdded);
        }