コード例 #1
0
        public void Json(string inputFilename, string expectedOutputFilename)
        {
            string input = File.ReadAllText(inputFilename);

            IConverter rebalanceInfoConverter = new CompositeTf2FormatConverter(new ValveFormatParser(), _transformations);
            IRebalanceInfoFormatter formatter = new RebalanceInfoJsonFormatter();

            IEnumerable <RebalanceInfo> rebalanceInfos = rebalanceInfoConverter.Execute(input);
            string output = formatter.Create(rebalanceInfos);

            string expectedOutput = File.ReadAllText(expectedOutputFilename);

            Assert.AreEqual(expectedOutput, output);
        }
        public void Json(string inputFilename, string expectedOutputFilename)
        {
            string input          = File.ReadAllText(inputFilename);
            string expectedOutput = File.ReadAllText(expectedOutputFilename);

            IConverter rebalanceInfoConverter = new GenericConverter <Node>(new ValveFormatParser(),
                                                                            new Tf2RebalanceTransformation(new ItemInfoSource(_itemInfos),
                                                                                                           new ClassNameSource()));
            IRebalanceInfoFormatter formatter = new RebalanceInfoJsonFormatter();

            IEnumerable <RebalanceInfo> rebalanceInfos = rebalanceInfoConverter.Execute(input);
            string output = formatter.Create(rebalanceInfos);

            Assert.AreEqual(expectedOutput, output);
        }