public void TimelineDao_Find_NotFoundException_IntegrationTest() { // Arrange ITimelineDao target = new TimelineDao(); // Act Timeline result = target.Find(-1); }
public void TimelineDao_Update_Exception_IntegrationTest() { using (var scope = new TransactionScope()) { // Arrange ITimelineDao target = new TimelineDao(); // Act target.Update(new Timeline()); } }
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); }
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); } }
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); } }