Example #1
0
        public void TimelineDao_Find_NotFoundException_IntegrationTest()
        {
            // Arrange
            ITimelineDao target = new TimelineDao();

            // Act
            Timeline result = target.Find(-1);
        }
Example #2
0
        public void TimelineDao_Update_Exception_IntegrationTest()
        {
            using (var scope = new TransactionScope())
            {
                // Arrange
                ITimelineDao target = new TimelineDao();

                // Act
                target.Update(new Timeline());
            }
        }
Example #3
0
        public void TimelineDao_Find_IntegrationTest()
        {
            // Arrange
            ITimelineDao target = new TimelineDao();

            // Act
            Timeline result = target.Find(1);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Id);
        }
Example #4
0
        public void TimelineDao_Add_IntegrationTest()
        {
            using (var scope = new TransactionScope())
            {
                // Arrange
                ITimelineDao target = new TimelineDao();

                // Act
                Timeline result = target.Add(new Timeline()
                {
                    BeginDate = 1900,
                    EndDate = 2000,
                    Title = "Test",
                    IsPublic = true,
                });

                // Assert
                Assert.IsTrue(result.Id != 0);
            }
        }
Example #5
0
        public void TimelineDao_Update_IntegrationTest()
        {
            using (var scope = new TransactionScope())
            {
                // Arrange
                ITimelineDao target = new TimelineDao();
                Timeline timeline;

                using (DatabaseContext context = new DatabaseContext())
                {
                    timeline = context.FirstOrDefault<Backend.Data.MSSQL.Entities.ContentItem, Timeline>("SELECT * FROM [dbo].[ContentItem] WHERE Id=@Id", new { Id = 1 });
                }

                // Act
                target.Update(timeline);
            }
        }