public void TestAddNullEventToTheDatabase() { EventBusiness mockEventBusiness = new EventBusiness(_mockContext.Object); Event mockEvent = null; Assert.Catch(() => mockEventBusiness.AddEvent(mockEvent), "Null event added to the database!"); }
public void TestAddNewEventToTheDatabase() { EventBusiness mockEventBusiness = new EventBusiness(_mockContext.Object); Event mockEvent = new Event() { EventId = 3, DueTime = DateTime.Now, Name = "name", UserId = 1 }; mockEventBusiness.AddEvent(mockEvent); Assert.Contains(mockEvent, mockEventBusiness.GetPODbContext.Events.ToList(), "Event not added properly!"); }