Ejemplo n.º 1
0
        public void ParseMultiDifferentJsonShouldReturnErrorMessage()
        {
            var firstJson  = PayloadLoader.GetPayloadAsString("TwoItemsPayload");
            var secondJson = PayloadLoader.GetPayloadAsString("SimplePayloadWithInsideObject");
            var sut        = JsonParserGeneralTest.GetNewConverter().ConvertMultipleIntoSingleTable(false, firstJson, secondJson);

            CommonTestsHelper.AssertValidTable(GeneralConstants.AllJsonsShouldHaveSameFieldNamsToConvertMultipleIntoOneTable, sut);
        }
Ejemplo n.º 2
0
        public void ParseCoupleOfSimpleJsonShouldReturnValidTableWithMultiLines()
        {
            var expectedTable = $"|name|Age|{Environment.NewLine}|this is a test|33|{Environment.NewLine}|this is a test|33|";
            var firstJson     = PayloadLoader.GetPayloadAsString("TwoItemsPayload");
            var SecondJson    = PayloadLoader.GetPayloadAsString("TwoItemsPayload");
            var sut           = JsonParserGeneralTest.GetNewConverter().ConvertMultipleIntoSingleTable(false, firstJson, SecondJson);

            CommonTestsHelper.AssertValidTable(expectedTable, sut);
        }
Ejemplo n.º 3
0
        public void ParseInvalidJsonShouldReturnErrorMessage()
        {
            var sut = JsonParserGeneralTest.GetNewConverter().ConvertMultipleIntoSingleTable(false, "{-01", "}{}");

            CommonTestsHelper.AssertValidTable(GeneralConstants.CouldNotConvertJsonIntoTableMessage, sut);
        }