示例#1
0
        public void Process_ReturnsExpectedCode(string resourceName)
        {
            var content  = GetResourceContent(resourceName);
            var parts    = content.Split("?=>");
            var code     = parts[0].Trim();
            var expected = parts[1].Trim();

            var result = CreateProcessor().Process(code, GetProcessingOptions(resourceName, content));

            Assert.True(result.IsSuccess, GetErrorString(result));
            AssertGold.Equal(expected, result.Decompiled.Trim());
        }
        public void Process_ReturnsExpectedCode(string resourceName)
        {
            var content  = GetResourceContent(resourceName);
            var parts    = content.Split("?=>");
            var code     = parts[0].Trim();
            var expected = parts[1].Trim();

            var service = CreateService();
            var result  = service.Process(code, GetProcessingOptions(resourceName, content));

            var errors = string.Join(Environment.NewLine, result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error));

            Assert.Equal("", errors);
            AssertGold.Equal(expected, result.Decompiled.Trim());
        }