Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFormatExceptionMessageWithoutParam()
        public virtual void shouldFormatExceptionMessageWithoutParam()
        {
            ExampleLogger logger = LOG;

            string id = "01";
            string messageTemplate = "Some message";

            string formattedMessage        = logger.exceptionMessage(id, messageTemplate);
            string expectedMessageTemplate = string.Format("{0}-{1}{2} {3}", PROJECT_CODE, COMPONENT_ID, id, messageTemplate);

            assertThat(formattedMessage).isEqualTo(expectedMessageTemplate);
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFormatExceptionMessageWithParams()
        public virtual void shouldFormatExceptionMessageWithParams()
        {
            ExampleLogger logger = LOG;

            string id = "01";
            string messageTemplate = "Some message '{}' '{}'";
            string p1 = "someParameter";
            string p2 = "someOtherParameter";

            string formattedMessage        = logger.exceptionMessage(id, messageTemplate, p1, p2);
            string expectedMessageTemplate = string.Format("{0}-{1}{2} Some message 'someParameter' 'someOtherParameter'", PROJECT_CODE, COMPONENT_ID, id);

            assertThat(formattedMessage).isEqualTo(expectedMessageTemplate);
        }