Beispiel #1
0
        public void when_nuget_is_support_replace_with_androidx()
        {
            var csproj = sampleCsProj;

            var resolver     = new TranslationResolver(new List <string>(), new List <string> {
            });
            var projectFixer = new ProjectRewriter(resolver, new NullProgress());

            csproj = projectFixer.RewriteCSProj(csproj);

            Assert.Contains(@"<PackageReference Include=""Xamarin.Google.Android.Material"" Version=""1.0.0-preview02"" />", csproj);
        }
Beispiel #2
0
        public void when_include_migration_then_migration_is_present()
        {
            var csproj = sampleCsProj;

            var resolver     = new TranslationResolver(new List <string>(), new List <string> {
            });
            var projectFixer = new ProjectRewriter(resolver, new NullProgress());

            csproj = projectFixer.RewriteCSProj(csproj, true);

            Assert.Contains(@"<PackageReference Include=""Xamarin.AndroidX.Migration"" Version=""1.0.0-preview03"" />", csproj);
        }
Beispiel #3
0
        public void when_version_is_inline_replace_inline()
        {
            var csproj = sampleCsProj;

            var resolver     = new TranslationResolver(new List <string>(), new List <string> {
            });
            var projectFixer = new ProjectRewriter(resolver, new NullProgress());

            csproj = projectFixer.RewriteCSProj(csproj);

            Assert.Contains(@"<PackageReference Include=""Xamarin.AndroidX.Browser"" Version=""1.0.0-preview02"" />", csproj);
        }
Beispiel #4
0
        public void in_poolmath_replace_androidx()
        {
            var csproj = poolMathCsproj;

            var resolver     = new TranslationResolver(new List <string>(), new List <string> {
            });
            var projectFixer = new ProjectRewriter(resolver, new NullProgress());

            csproj = projectFixer.RewriteCSProj(csproj);

            Assert.Contains(@"<PackageReference Include=""Xamarin.AndroidX.Core"">
      <Version>1.0.1-preview02</Version>
    </PackageReference>", csproj);
        }
Beispiel #5
0
        public void when_nuget_version_is_not_inlined_replace_it()
        {
            var csproj = versionedCsProj;

            var resolver     = new TranslationResolver(new List <string>(), new List <string> {
            });
            var projectFixer = new ProjectRewriter(resolver, new NullProgress());

            csproj = projectFixer.RewriteCSProj(csproj);

            Assert.Contains(@"<PackageReference Include=""Xamarin.Google.Android.Material"">", csproj);
            Assert.DoesNotContain(@"<Version>28.0.0.1</Version>", csproj);
            Assert.Contains(@"<Version>1.0.0-preview02</Version>", csproj);      //replace version number
            Assert.Contains(@"<Version>27.0.0.1</Version>", csproj);             //don't remove version for xamarin.essentials
        }