public void AddSpecificMessagePart_When_Called_Uses_CultureInfo() { // Arrange Int64 expectedSeconds = 2; Double actualSeconds = 5; string descr = "some description"; NotExceedTotalSecondsAssertionMessage notExceedsSecondsAssertionMessage = new NotExceedTotalSecondsAssertionMessage(expectedSeconds, actualSeconds, descr); StringBuilder sb = new StringBuilder(); var cultureInfoMock = new Mock <CultureInfo>("es-ES"); // Act notExceedsSecondsAssertionMessage.AddSpecificMessagePart(sb, cultureInfoMock.Object); // Assert cultureInfoMock.VerifyAll(); }
public void AddSpecificMessagePart_When_Called_Adds_Own_String_To_Provided_StringBuilder() { // Arrange Int64 expectedSeconds = 2; Double actualSeconds = 5; string descr = "some description"; NotExceedTotalSecondsAssertionMessage notExceedsSecondsAssertionMessage = new NotExceedTotalSecondsAssertionMessage(expectedSeconds, actualSeconds, descr); StringBuilder sb = new StringBuilder(); // Act notExceedsSecondsAssertionMessage.AddSpecificMessagePart(sb, CultureInfo.InvariantCulture); // Assert var resString = sb.ToString(); var expectedString = $"Expected total seconds not to exceed 2, but had: 5 total seconds.{Environment.NewLine}"; Assert.AreEqual(expectedString, resString); }