Exemplo n.º 1
0
        public void ParseSourceMap_SimpleSourceMap_CorrectlyParsed()
        {
            // Arrange
            SourceMapParser sourceMapParser = new SourceMapParser();
            string          input           = "{ \"version\":3, \"file\":\"CommonIntl\", \"lineCount\":65, \"mappings\":\"AACAA,aAAA,CAAc\", \"sources\":[\"input/CommonIntl.js\"], \"names\":[\"CommonStrings\",\"afrikaans\"]}";

            // Act
            SourceMap output = sourceMapParser.ParseSourceMap(UnitTestUtils.StreamReaderFromString(input));

            // Assert
            Assert.Equal(3, output.Version);
            Assert.Equal("CommonIntl", output.File);
            Assert.Equal("AACAA,aAAA,CAAc", output.Mappings);
            Assert.Equal(1, output.Sources.Count);
            Assert.Equal("input/CommonIntl.js", output.Sources[0]);
            Assert.Equal(2, output.Names.Count);
            Assert.Equal("CommonStrings", output.Names[0]);
            Assert.Equal("afrikaans", output.Names[1]);
        }