Пример #1
0
        public void AddSpecificMessagePart_When_Called_Uses_CultureInfo()
        {
            // Arrange
            Int64  expectedAverageMinutes = 1;
            Double actualAverageMinutes   = 2;
            string descr = "some description";
            NotExceedAverageMinutesAssertionMessage notExceedsAverageMinutesAssertionMessage = new NotExceedAverageMinutesAssertionMessage(expectedAverageMinutes, actualAverageMinutes, descr);
            StringBuilder sb = new StringBuilder();
            var           cultureInfoMock = new Mock <CultureInfo>("es-ES");

            // Act
            notExceedsAverageMinutesAssertionMessage.AddSpecificMessagePart(sb, cultureInfoMock.Object);

            // Assert
            cultureInfoMock.VerifyAll();
        }
Пример #2
0
        public void AddSpecificMessagePart_When_Called_Adds_Own_String_To_Provided_StringBuilder()
        {
            // Arrange
            Int64  expectedAverageMinutes = 1;
            Double actualAverageMinutes   = 2;
            string descr = "some description";
            NotExceedAverageMinutesAssertionMessage notExceedsAverageMinutesAssertionMessage = new NotExceedAverageMinutesAssertionMessage(expectedAverageMinutes, actualAverageMinutes, descr);
            StringBuilder sb = new StringBuilder();

            // Act
            notExceedsAverageMinutesAssertionMessage.AddSpecificMessagePart(sb, CultureInfo.InvariantCulture);

            // Assert
            var resString      = sb.ToString();
            var expectedString = $"Expected average (per run) minutes not to exceed 1, but had: 2 average minutes.{Environment.NewLine}";

            Assert.AreEqual(expectedString, resString);
        }