Пример #1
0
        public void Post_props_are_set_on_create_test()
        {
            var image = new Images
            {
                Id = 1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };

            var post = new Posts
            {
                Id = 5,
                Content = "Det her er en test",
                Header = "Test",
                Subject = "Testing",
                Summary = "Testet",
                Images = image
            };

            Assert.AreEqual(post.Id, 5);
            Assert.AreEqual(post.Content, "Det her er en test");
            Assert.AreEqual(post.Header, "Test");
            Assert.AreEqual(post.Subject, "Testing");
            Assert.AreEqual(post.Summary, "Testet");
            Assert.AreEqual(post.Images.Id, 1);
            Assert.AreEqual(post.Images.ImageName, "TestImage");
            Assert.AreEqual(post.Images.ImagePath, "Image");
            Assert.AreEqual(post.Images.ImageUrl, "Image");
        }
        public void Post_is_updated_after_update()
        {
            var image = new Images
            {
                Id = -1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };
            facade.GetImageRepository().Add(image);
            var post1 = new Posts() {
                Id = 1,Summary = "Test",
                Subject = "Tests",
                Header = "Still a Test",
                Content = "This is a very good test thing...",
                Images = image
            };
            facade.GetPostRepository().Add(post1);
            Assert.IsNotNull(post1);

            var newheader = "shaun";
            post1.Header = newheader;

            facade.GetPostRepository().Update(post1);
            Assert.AreEqual(newheader, post1.Header);
        }
        public void Event_is_updated_after_update()
        {
            var image = new Images
            {
                Id = -1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };
            facade.GetImageRepository().Add(image);

            Events eve = new Events()
            {
                Id = -1,
                EventTitle = "Julefrokost",
                EventInfo = "Event info",
                DateEnd = DateTime.Parse("2015-12-17 00:00:00.000"),
                DateStart = DateTime.Parse("2015-12-18 00:00:00.000"),
                Images = image

            };
            facade.GetEventRepository().Add(eve);
            Assert.IsNotNull(eve);

            var newname = "shaun";
            eve.EventTitle = newname;

            facade.GetEventRepository().Update(eve);
            Assert.AreEqual(newname, eve.EventTitle);
        }
        public void Event_is_in_db_after_add()
        {
            var image = new Images
            {
                Id = -1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };
            facade.GetImageRepository().Add(image);

            Events eve = new Events()
            {
                Id = -1,
                EventTitle = "Julefrokost",
                EventInfo = "Event info",
                DateEnd = DateTime.Parse("2015-12-17 00:00:00.000"),
                DateStart = DateTime.Parse("2015-12-18 00:00:00.000"),
                Images = image

            };

            facade.GetEventRepository().Add(eve);

            Assert.IsTrue(eve.Id > 0);

            var eve2 = facade.GetEventRepository().Read(eve.Id);

            Assert.AreEqual(eve, eve2);
        }
        public void Team_is_in_db_after_add()
        {
            var image = new Images
            {
                Id = -1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };
            facade.GetImageRepository().Add(image);

            var team = new Teams
            {
                Id = -1,
                Name = "ShaunHold",
                Info = "Det bedste hold",
                Instructors = "Shaun",
                TeamLeader = "Shaun",
                AssistInstructor = "Shaun",
                AgeGroup = "9 år",
                Weekday = "Torsdag",
                Place = "Oksbøl Hal",
                Price = 200,
                StartTime = 1900,
                EndTime = 2000,
                PaymentUrl = "HejURL",
                Images = image
            };
            facade.GetTeamRepository().Add(team);
            Assert.IsTrue(team.Id > 0);

            var team2 = facade.GetTeamRepository().Read(team.Id);

            Assert.AreEqual(team, team2);
        }
        public void Image_props_are_set_on_create_test()
        {
            var image = new Images
            {
                Id = 1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };

            Assert.AreEqual(image.Id, 1);
            Assert.AreEqual(image.ImageName, "TestImage");
            Assert.AreEqual(image.ImagePath, "Image");
            Assert.AreEqual(image.ImageUrl, "Image");
        }
        public void Image_is_in_db_after_add()
        {
            var image = new Images
            {
                Id = -1,
                ImageName = "ShaunsImage",
                ImagePath = "image",
                ImageUrl = "image"
            };

            facade.GetImageRepository().Add(image);

            Assert.IsTrue(image.Id > 0);

            var image2 = facade.GetImageRepository().Read(image.Id);

            Assert.AreEqual(image, image2);
        }
Пример #8
0
        public void Team_props_are_set_on_create_test()
        {
            var image = new Images
            {
                Id = 5,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };

            var team = new Teams
            {
                Id = 1,
                Name = "ShaunHold",
                Info = "Det bedste hold",
                TeamLeader = "Shaun",
                AssistInstructor = "Shaun",
                AgeGroup = "9 år",
                Instructors = "Shaun",
                Weekday = "Torsdag",
                Place = "Oksbøl Hal",
                Price = 200,
                StartTime = 1900,
                EndTime = 2000,
                PaymentUrl = "HejURL",
                Images = image
            };

            Assert.AreEqual(team.Id, 1);
            Assert.AreEqual(team.Name, "ShaunHold");
            Assert.AreEqual(team.Info, "Det bedste hold");
            Assert.AreEqual(team.Instructors, "Shaun");
            Assert.AreEqual(team.Weekday, "Torsdag");
            Assert.AreEqual(team.Place, "Oksbøl Hal");
            Assert.AreEqual(team.Price, 200);
            Assert.AreEqual(team.StartTime, 1900);
            Assert.AreEqual(team.EndTime, 2000);
            Assert.AreEqual(team.PaymentUrl, "HejURL");
            Assert.AreEqual(team.Images.Id, 5);
            Assert.AreEqual(team.Images.ImageName, "TestImage");
            Assert.AreEqual(team.Images.ImageUrl, "Image");
            Assert.AreEqual(team.Images.ImagePath, "Image");
        }
 public void Post_is_in_db_after_add()
 {
     var image = new Images
     {
         Id = -1,
         ImageName = "TestImage",
         ImagePath = "Image",
         ImageUrl = "Image"
     };
     facade.GetImageRepository().Add(image);
     var post = new Posts
     {
         Id = -1,
         Header = "Test",
         Content = "TestyTestTest",
         Subject = "This is a Test",
         Summary = "Still a test",
         Images = image
     };
     facade.GetPostRepository().Add(post);
     Assert.IsTrue(post.Id > 0);
     var post2 = facade.GetPostRepository().Read(post.Id);
     Assert.AreEqual(post, post2);
 }
        public void Team_is_updated_after_update()
        {
            var image = new Images
            {
                Id = -1,
                ImageName = "TestImage",
                ImagePath = "Image",
                ImageUrl = "Image"
            };
            facade.GetImageRepository().Add(image);

            var team = new Teams { Id = 6, Name = "Testhold", Info = "De springer.", Price = 100, Images = image };

            facade.GetTeamRepository().Add(team);
            Assert.IsNotNull(team);

            var newname = "shaun";
            team.Name = newname;

            facade.GetTeamRepository().Update(team);
            Assert.AreEqual(newname, team.Name);
        }