public async Task BuildAsync_WhenCalled_AssertConvertNewLinesWasCalledOnHtmlHelperWithInformation() { string information = Guid.NewGuid().ToString("D"); ISystemError systemError = CreateSystemError(information: information); IViewModelBuilder <SystemErrorViewModel, ISystemError> sut = CreateSut(); await sut.BuildAsync(systemError); _htmlHelperMock.Verify(m => m.ConvertNewLines(It.Is <string>(value => string.Compare(value, information, false) == 0)), Times.Once); }
public async Task BuildAsync_WhenCalled_ReturnsInitializedSystemErrorViewModel() { string identifier = Guid.NewGuid().ToString("D"); DateTime timestamp = DateTime.Now.AddTicks(_random.Next(-5000, 5000)); string information = Guid.NewGuid().ToString("D"); string details = Guid.NewGuid().ToString("D"); ISystemError systemErrorMock = CreateSystemError(identifier, timestamp, information, details); IViewModelBuilder <SystemErrorViewModel, ISystemError> sut = CreateSut(); SystemErrorViewModel result = await sut.BuildAsync(systemErrorMock); Assert.IsNotNull(result); Assert.IsNotNull(result.SystemErrorIdentifier); Assert.AreEqual(identifier, result.SystemErrorIdentifier); Assert.AreEqual(timestamp, result.Timestamp); Assert.IsNotNull(result.Message); Assert.AreEqual($"HtmlHelper.ConvertNewLines:{information}", result.Message); Assert.IsNotNull(result.Details); Assert.AreEqual($"HtmlHelper.ConvertNewLines:{details}", result.Details); }
/// <summary> /// for test /// </summary> public GetSystemError(Account loginUser, ISystemError iSystemError, GetEmployee iAccountBll) : this(loginUser) { _ISystemError = iSystemError; _GetEmployee = iAccountBll; }
/// <summary> /// for test /// </summary> public UpdateSystemErrorStatus(SystemError systemError, ISystemError isystemError) : this(systemError) { _ISystemError = isystemError; }