public async Task TestDeleteMinute() { Mock <IMinuteRepository> mock = new Mock <IMinuteRepository>(); MinuteController controller = new MinuteController(mock.Object); Minute minute = new Minute() { Id = new Guid() }; mock.Setup(t => t.Delete(It.IsAny <Minute>())).Verifiable(); await controller.DeleteMinute(minute); mock.VerifyAll(); }
public async Task TestDeleteMinuteNull() { Mock <IMinuteRepository> mock = new Mock <IMinuteRepository>(); MinuteController controller = new MinuteController(mock.Object); Minute minute = null; ArgumentNullException exception = await Assert.ThrowsExceptionAsync <ArgumentNullException>(() => controller.DeleteMinute(minute)); Assert.AreEqual(exception.ParamName, nameof(minute)); }