public async Task NotifyTriangleTasks_HasTasksToNotify_Notify() { IEmailService emailService = A.Fake <IEmailService>(); IWorkTaskService workTaskService = A.Fake <IWorkTaskService>(); TaskTriangleBuilder taskTriangleBuilder = new TaskTriangleBuilder(); TaskTriangle taskTriangle = taskTriangleBuilder.AddContent("content1") .AddResource("resource1") .AddPercentageProgressToNotify(60) .SetTime("20/09/2020", DayPeriod.Noon, 4, halfWorkDay: true) .Build(); IWorkTask workTask = A.Fake <IWorkTask>(); A.CallTo(() => workTask.TaskMeasurement).Returns(taskTriangle); List <IWorkTask> workTasks = new List <IWorkTask>() { workTask }; A.CallTo(() => workTaskService.FindWorkTasksByConditionAsync(A <Func <IWorkTask, bool> > .Ignored)) .Returns(workTasks); NotifierService notifierService = new NotifierService( emailService, workTaskService, NullLogger <NotifierService> .Instance); await notifierService.NotifyTriangleTasks().ConfigureAwait(false); A.CallTo(() => emailService.SendEmail(A <string> .Ignored)).MustHaveHappenedOnceExactly(); }
/// <summary> /// <see cref="CustomAuthenticationStateProvider"/> クラスの新しいインスタンスを作成します。 /// </summary> /// <param name="notifierService">シングルトン <see cref="NotifierService"/>。</param> /// <param name="http">シングルトン <see cref="HttpClient"/>。</param> /// <param name="jSRuntime">シングルトン <see cref="JSRuntime"/>。</param> /// <param name="loginAuthorized">シングルトン <see cref="LoginAuthorizedModel"/>。</param> public CustomAuthenticationStateProvider( NotifierService notifierService, HttpClient http, IJSRuntime jSRuntime, ILoginAuthorizedModel loginAuthorized ) { this._notifier = notifierService; this._http = http; this._jSRuntime = jSRuntime; this._loginAuthorized = loginAuthorized; }
public async Task NotifyTriangleTasks_HasNoTasksToNotify_DoesNotNotify() { IEmailService emailService = A.Fake <IEmailService>(); IWorkTaskService workTaskService = A.Fake <IWorkTaskService>(); A.CallTo(() => workTaskService.FindWorkTasksByConditionAsync(A <Func <IWorkTask, bool> > .Ignored)) .Returns(new List <IWorkTask>()); NotifierService notifierService = new NotifierService( emailService, workTaskService, NullLogger <NotifierService> .Instance); await notifierService.NotifyTriangleTasks().ConfigureAwait(false); A.CallTo(() => emailService.SendEmail(A <string> .Ignored)).MustNotHaveHappened(); }
public TimerService(NotifierService notifier, ILogger <TimerService> logger) { this.notifier = notifier; this.logger = logger; }
public void TestMethod4() { var s = new NotifierService(); new NotifierTestCollection(s).DoTest(); }
public void TestMethod3() { var s = new NotifierService(); new NotifierTestGranpa(s).DoTest(); }
public void TestMethod2() { var s = new NotifierService(); new NotifierTestParent(s).DoTest(); }