Beispiel #1
0
        public void SampleCanGetMakeForModel()
        {
            var repo = new MakesRepositorySampleData();

            var make = repo.GetMakeForModel(7);

            Assert.AreEqual(2, make.MakeId);
            Assert.AreEqual("00000000-0000-0000-0000-000000000000", make.UserId);
            Assert.AreEqual("Ford", make.MakeDescription);
            Assert.AreEqual(DateTime.Parse("07/22/2018 00.00.00 AM", System.Globalization.CultureInfo.InvariantCulture), make.MakeDateAdded);
        }
Beispiel #2
0
        public void SampleDataCanLoadMakes()
        {
            var repo = new MakesRepositorySampleData();

            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);
        }
Beispiel #3
0
        public static void SampleDataCanAddMake()
        {
            Makes makeToAdd = new Makes();
            var   repo      = new MakesRepositorySampleData();

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

            repo.DeleteMake(4);
        }