public void AddSpecificMessagePart_When_Called_Uses_CultureInfo() { // Arrange Int64 expectedMaxMilliseconds = 342; Double actualMilliseconds = 22112; string descr = "some description"; NotExceedTotalMillisecondsAssertionMessage notExceedsMillisecondsAssertionMessage = new NotExceedTotalMillisecondsAssertionMessage(expectedMaxMilliseconds, actualMilliseconds, descr); StringBuilder sb = new StringBuilder(); var cultureInfoMock = new Mock <CultureInfo>("es-ES"); // Act notExceedsMillisecondsAssertionMessage.AddSpecificMessagePart(sb, cultureInfoMock.Object); // Assert cultureInfoMock.VerifyAll(); }
public void AddSpecificMessagePart_When_Called_Adds_Own_String_To_Provided_StringBuilder() { // Arrange Int64 expectedMaxMilliseconds = 342; Double actualMilliseconds = 22112; string descr = "some description"; NotExceedTotalMillisecondsAssertionMessage notExceedsMillisecondsAssertionMessage = new NotExceedTotalMillisecondsAssertionMessage(expectedMaxMilliseconds, actualMilliseconds, descr); StringBuilder sb = new StringBuilder(); // Act notExceedsMillisecondsAssertionMessage.AddSpecificMessagePart(sb, CultureInfo.InvariantCulture); // Assert var resString = sb.ToString(); var expectedString = $"Expected total milliseconds not to exceed 342, but had: 22112 total milliseconds.{Environment.NewLine}"; Assert.AreEqual(expectedString, resString); }