コード例 #1
0
        public void when_defining_types_then_dont_break_fully_qualified()
        {
            var solution = CreateSolution(@"
		using System;

		namespace ClassLibrary1 
		{
			public class MainActivity : Android.Support.V7.App.AppCompatActivity 
			{
			}
		}"        );

            var methodFixer = new SemanticRewriter(resolver, new NullProgress());

            solution = methodFixer.Visit(solution, GetFirstDocument(solution));

            var root = GetText(solution);

            Assert.Contains(": Android.Support.V7.App.AppCompatActivity", root);
        }
コード例 #2
0
        public void when_defining_aliased_namespaces_then_fully_qualify_if_needed()
        {
            var solution = CreateSolution(@"
		using System;
		using support = Android.Support;

		namespace ClassLibrary1 
		{
			public class MainActivity : support.V7.App.AppCompatActivity 
			{
			}
		}"        );

            var methodFixer = new SemanticRewriter(resolver, new NullProgress());
            var typeFixer   = new TypeRewriter(resolver, new NullProgress());

            solution = methodFixer.Visit(solution, GetFirstDocument(solution));
            solution = typeFixer.Visit(solution, GetFirstDocument(solution));

            var root = GetText(solution);

            Assert.Contains(": AndroidX.AppCompat.App.AppCompatActivity", root);
            Assert.DoesNotContain(": support.V7.App.AppCompatActivity", root);
        }