コード例 #1
0
ファイル: AlertServiceTests.cs プロジェクト: KevinTss/nyss
        public async Task ReportDismissed_WhenDismissingNonExistingAlert_ShouldDoNothingAndLogWarning()
        {
            //arrange
            _testData.WhenAddingToGroupWithAnExistingAlert.GenerateData().AddToDbContext();

            //act
            await _alertService.ReportDismissed(AlertServiceTestData.SimpleTestCaseAdditionalData.NotExistingReportId);

            //assert
            _loggerAdapterMock.Received(1).Warn(Arg.Any <string>());
            await _nyssContextMock.Received(0).SaveChangesAsync();

            _nyssContextMock.Received(0).SaveChanges();
            await _nyssContextMock.Received(0).ExecuteSqlInterpolatedAsync(Arg.Any <FormattableString>());
        }