RefineResource() публичный Метод

public RefineResource ( string resource ) : void
resource string
Результат void
Пример #1
0
        public void FxCopLogReader_Context_RefineResource()
        {
            FxCopLogReader.Context context = TestHelper.CreateProjectContext();

            context.RefineResource("myresource.resx");
            Assert.Equal("myresource.resx", context.Resource);
        }
Пример #2
0
        public void FxCopConverter_CreateResult_FakeContext_Resource()
        {
            FxCopLogReader.Context context = TestHelper.CreateProjectContext();

            context.RefineTarget(@"mybinary.dll");
            context.RefineModule("mybinary.dll");
            context.RefineResource("myresource.resx");
            context.RefineMessage("CA0000", "VeryUsefulCheck", null, null, null, null);
            context.RefineIssue("hello!", "test", null, null, @"source", "myfile.cs", 13);

            var expectedLogicalLocations = new List <LogicalLocation>
            {
                new LogicalLocation {
                    Kind = LogicalLocationKind.Module, Name = "mybinary.dll"
                },
                new LogicalLocation {
                    ParentIndex = 0, Name = "myresource.resx", FullyQualifiedName = "mybinary.dll!myresource.resx", Kind = LogicalLocationKind.Resource
                }
            };

            var    converter = new FxCopConverter();
            Result result    = converter.CreateResult(context);

            ValidateLogicalLocations(expectedLogicalLocations, converter.LogicalLocations);
        }
Пример #3
0
        public void FxCopConverter_CreateResult_FakeContext_NoModule_Resource()
        {
            FxCopLogReader.Context context = TestHelper.CreateProjectContext();

            context.RefineTarget(@"mybinary.dll");
            context.RefineResource("myresource.resx");
            context.RefineMessage("CA0000", "VeryUsefulCheck", null, null, null, null);
            context.RefineIssue("hello!", "test", null, null, null, null, null);

            var    converter = new FxCopConverter();
            Result result    = converter.CreateResult(context);

            result.Locations.First().LogicalLocation.FullyQualifiedName.Should().Be(@"myresource.resx");
        }
Пример #4
0
        public void FxCopLogReader_Context_RefineProjectToResourceIssue()
        {
            FxCopLogReader.Context context = TestHelper.CreateProjectContext();

            context.RefineTarget("mybinary.dll");
            context.RefineModule("mybinary.dll");
            context.RefineResource("myresource.resx");
            context.RefineMessage("CA0000", "VeryUsefulCheck", "1", "MyCategory", "Breaking", null);

            context.RefineIssue("hello!", "test", "25", "error", "source", "myresource.resx", 13);
            Assert.Equal("mybinary.dll", context.Target);
            Assert.Equal("mybinary.dll", context.Module);
            Assert.Equal("myresource.resx", context.Resource);
            Assert.Equal("CA0000", context.CheckId);
            Assert.Equal("1", context.MessageId);
            Assert.Equal("MyCategory", context.Category);
            Assert.Equal("VeryUsefulCheck", context.Typename);
            Assert.Equal("Breaking", context.FixCategory);
            Assert.Equal("hello!", context.Message);
            Assert.Equal("test", context.ResolutionName);
            Assert.Equal("25", context.Certainty);
            Assert.Equal("error", context.Level);
            Assert.Equal("source", context.Path);
            Assert.Null(context.Status);
            Assert.Equal("myresource.resx", context.File);
            Assert.Equal(13, context.Line.Value);

            context.ClearTarget();
            Assert.Null(context.Target);
            Assert.Null(context.Module);
            Assert.Null(context.Resource);
            Assert.Null(context.Namespace);
            Assert.Null(context.Type);
            Assert.Null(context.Member);
            Assert.Null(context.Message);
            Assert.Null(context.ResolutionName);
        }