Пример #1
0
        public void DoesNotFindIssue_WhenNoneExists()
        {
            var xaml = "<Foo Bar=\"Enabled\">";

            var rxElement = CustomAnalysisTestHelper.StringToElement(xaml);

            var sut = new FooAnalysis();

            var actual = sut.Analyze(rxElement, FakeExtraAnalysisDetails.Create());

            Assert.AreEqual(0, actual.Actions.Count);
            Assert.IsTrue(actual.IsNone);
        }
Пример #2
0
        public void FindsIssue_WhenExists()
        {
            var xaml = @"<Foo />";

            var rxElement = CustomAnalysisTestHelper.StringToElement(xaml);

            var sut = new FooAnalysis();

            var actual = sut.Analyze(rxElement, FakeExtraAnalysisDetails.Create());

            Assert.AreEqual(1, actual.Actions.Count);
            Assert.AreEqual(ActionType.AddAttribute, actual.Actions[0].Action);
        }