예제 #1
0
    public void Execute()
    {
        msCoreReferenceFinder = new MsCoreReferenceFinder
                                        {
                                            AssemblyResolver = ModuleDefinition.AssemblyResolver,
                                        };
        msCoreReferenceFinder.Execute();
        var comparisonFinder = new DefaultStringComparisonFinder
                                   {
                                       ModuleWeaver = this,
                                       MsCoreReferenceFinder = msCoreReferenceFinder,
                                   };
        comparisonFinder.Execute();
        converterCache = new ConverterCache
                             {
                                 MsCoreReferenceFinder = msCoreReferenceFinder,
                                 ModuleDefinition = ModuleDefinition,
                                 DefaultStringComparisonFinder = comparisonFinder
                             };
        converterCache.Execute();

        foreach (var type in ModuleDefinition.GetTypes())
        {
            if (type.IsInterface)
            {
                continue;
            }
            if (type.IsEnum)
            {
                continue;
            }
            ProcessType(type);
        }
    }
예제 #2
0
    public void Execute()
    {
        msCoreReferenceFinder = new MsCoreReferenceFinder
        {
            AssemblyResolver = ModuleDefinition.AssemblyResolver,
        };
        msCoreReferenceFinder.Execute();
        var comparisonFinder = new DefaultStringComparisonFinder
        {
            ModuleWeaver          = this,
            MsCoreReferenceFinder = msCoreReferenceFinder,
        };

        comparisonFinder.Execute();
        converterCache = new ConverterCache
        {
            MsCoreReferenceFinder         = msCoreReferenceFinder,
            ModuleDefinition              = ModuleDefinition,
            DefaultStringComparisonFinder = comparisonFinder
        };
        converterCache.Execute();

        foreach (var type in ModuleDefinition.GetTypes())
        {
            if (type.IsInterface)
            {
                continue;
            }
            if (type.IsEnum)
            {
                continue;
            }
            ProcessType(type);
        }
    }
    public void GetStringComparisonFromXmlEmpty()
    {
        var xElement  = XElement.Parse("<Caseless StringComparison=''/>");
        var exception = Assert.Throws <WeavingException>(() => DefaultStringComparisonFinder.GetStringComparisonFromXml(xElement));

        Assert.Equal("Expected StringComparison to have a value.", exception.Message);
    }
    public void GetStringComparisonFromXmlEmpty()
    {
        var xElement  = XElement.Parse("<Caseless StringComparison=''/>");
        var exception = Assert.Throws <WeavingException>(() => DefaultStringComparisonFinder.GetStringComparisonFromXml(xElement));

        Approvals.Verify(exception.Message);
    }
예제 #5
0
    public override void Execute()
    {
        FindCoreReferences();
        var comparisonFinder = new DefaultStringComparisonFinder
        {
            ModuleWeaver = this
        };

        comparisonFinder.Execute();
        converterCache = new ConverterCache
        {
            ModuleWeaver     = this,
            ModuleDefinition = ModuleDefinition,
            DefaultStringComparisonFinder = comparisonFinder
        };
        converterCache.Execute();

        foreach (var type in ModuleDefinition.GetTypes())
        {
            if (type.IsInterface)
            {
                continue;
            }

            if (type.IsEnum)
            {
                continue;
            }

            ProcessType(type);
        }
    }
    public void GetStringComparisonFromXmlTrim()
    {
        var xElement = XElement.Parse("<Caseless StringComparison=' InvariantCultureIgnoreCase '/>");

        Assert.Equal("InvariantCultureIgnoreCase", DefaultStringComparisonFinder.GetStringComparisonFromXml(xElement));
    }
 public void GetStringComparisonFromXmlNull()
 {
     DefaultStringComparisonFinder.GetStringComparisonFromXml(null);
 }
예제 #8
0
    public void GetStringComparisonFromXmlEmpty()
    {
        var xElement = XElement.Parse("<Caseless StringComparison=''/>");

        DefaultStringComparisonFinder.GetStringComparisonFromXml(xElement);
    }