using Model; namespace UTests2; public class MockEmailService : IEmailService { public Func AskConfirmation {get; set;} = null!; Task IEmailService.AskConfirmation(Nounours nounours) { if(AskConfirmation != null) { if(AskConfirmation(nounours)) { return Task.CompletedTask; } else { throw new Exception(); } } throw new Exception(); } }