Esempio n. 1
0
        public static void SampleDataCanAddAndDeleteSpecial()
        {
            Specials specialToAdd = new Specials();
            var      repo         = new SpecialsRepositorySampleData();

            specialToAdd.SpecialTitle       = "Fourth Special";
            specialToAdd.SpecialDescription = "Special4 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna arcu, congue sit amet mattis quis, molestie a sem. ";

            repo.AddSpecial(specialToAdd);
            var specials = repo.GetAllSpecials().ToList();
            var special  = repo.GetSpecialById(4);

            Assert.IsNotNull(special);
            Assert.AreEqual(4, specials.Count);

            Assert.AreEqual(4, specials[3].SpecialId);
            Assert.AreEqual("Fourth Special", specials[3].SpecialTitle);
            Assert.AreEqual("Special4 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna arcu, congue sit amet mattis quis, molestie a sem. ", specials[3].SpecialDescription);

            repo.DeleteSpecial(4);

            specials = repo.GetAllSpecials().ToList();
            special  = repo.GetSpecialById(4);

            Assert.IsNull(special);
            Assert.AreEqual(3, specials.Count);
        }
Esempio n. 2
0
        public static void SampleDataCanGetSpecial()
        {
            var repo = new SpecialsRepositorySampleData();

            repo.GetSpecialById(2);

            var specials = repo.GetAllSpecials().ToList();

            Assert.AreEqual(3, specials.Count);
            Assert.AreEqual(3, specials[2].SpecialId);
            Assert.AreEqual("Third Special", specials[2].SpecialTitle);
            Assert.AreEqual("Special3 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna arcu, congue sit amet mattis quis, molestie a sem.  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna arcu, congue sit amet mattis quis, molestie a sem.  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum magna arcu, congue sit amet mattis quis, molestie a sem.", specials[2].SpecialDescription);
        }