コード例 #1
0
        public void ConvertionWithCodeGenOptionShouldReturnNormalizedAndWithTheRightAttribute()
        {
            var sut = new JsonConverterToExampleTable();
            var convertionResult = sut.Convert(PayloadLoader.GetPayloadAsString("SimplePayloadWithInsideObject"), true);

            AssertConvertionResult(convertionResult, JsonParserGeneralTest.SimplePayloadWithInsideObjectExpectedTable, ExpectedNormalizedwithAttribute);
        }
コード例 #2
0
        public void SimpleConvertionWithCodeGenOptionShouldCreateTableAndCodeOutput()
        {
            var sut = new JsonConverterToExampleTable();
            var convertionResult = sut.Convert(PayloadLoader.GetPayloadAsString("TwoItemsPayload"), true);

            AssertConvertionResult(convertionResult, JsonParserGeneralTest.ExpectedTableTwoItemsPayload, ExpectedSimpleCode);
        }
コード例 #3
0
        private static ConvertionService CreateService()
        {
            var mockLogger    = new Mock <ILogger <ConvertionService> >();
            var jsonConverter = new JsonConverterToExampleTable();
            var clipBoard     = new Clipboard();

            return(new ConvertionService(mockLogger.Object, jsonConverter, clipBoard));
        }
コード例 #4
0
        private static (ITestSink, ConvertionService) CreateServiceWithSink()
        {
            var(sink, logFactory) = LogTestHelperInitialization.Create();
            var mockLogger        = logFactory.CreateLogger <ConvertionService>();
            var jsonConverter     = new JsonConverterToExampleTable();
            var clipboard         = new Mock <Clipboard>();
            var convertionService = new ConvertionService(mockLogger, jsonConverter, clipboard.Object);

            return(sink, convertionService);
        }