public void ThenISetCurrencyInUkrainianBanksRatesSection(string currency)
 {
     StringAssert.AreEqualIgnoringCase(currency, financePage.SetCurrensy(currency));
 }
Esempio n. 2
0
 public static string ShouldBeEqualIgnoringCase(this string actual, string expected)
 {
     StringAssert.AreEqualIgnoringCase(expected, actual);
     return(expected);
 }
Esempio n. 3
0
        public void Empty()
        {
            StringFormatter stringFormatter = new StringFormatter();

            StringAssert.AreEqualIgnoringCase(stringFormatter.WebString(""), "");
        }
 public void AssertHeader()
 {
     StringAssert.AreEqualIgnoringCase("Sign-In", Header.Text);
 }
Esempio n. 5
0
        public void ThenstatusdescriptionShouldBe(string statusDesc)
        {
            var response = _restHelper.GetResponse();

            StringAssert.AreEqualIgnoringCase(statusDesc, response.StatusCode.ToString());
        }
Esempio n. 6
0
        public void New_Returns_Request_With_Specified_Method(string input)
        {
            var request = new SodaRequest(exampleUri, input, null, null, null);

            StringAssert.AreEqualIgnoringCase(input, request.webRequest.Method);
        }
Esempio n. 7
0
        public void ProcessContentWithMarkdownFlavorShouldProcessAppRelativeUrls()
        {
            var result = m_filter.ProcessContent(@"[inline-style link](~/relative-path)", "markdown");

            StringAssert.AreEqualIgnoringCase(@"[inline-style link](/OrchardLocal/relative-path)", result);
        }
Esempio n. 8
0
 public void GetDomainControllerForComputer(string computerName, string domain, string expected)
 {
     StringAssert.AreEqualIgnoringCase(expected, discoveryServices.GetDomainController(computerName, domain, Interop.DsGetDcNameFlags.DS_DIRECTORY_SERVICE_REQUIRED));
 }
Esempio n. 9
0
 public void GetSiteForComputer(string computer, string expected)
 {
     StringAssert.AreEqualIgnoringCase(expected, discoveryServices.GetComputerSiteNameRpc(computer));
 }
Esempio n. 10
0
        public void DeviceManagementRequests_c_Get()
        {
            var result = client.GetDeviceManagementRequest(dmReqId);

            StringAssert.AreEqualIgnoringCase(result["action"], "device/reboot");
        }
Esempio n. 11
0
        public void GetOrganizationDetail()
        {
            var result = client.GetOrganizationDetail();

            StringAssert.AreEqualIgnoringCase(orgId, result["id"]);
        }
Esempio n. 12
0
        public void GetServiceStatus()
        {
            var result = client.GetServiceStatus();

            StringAssert.AreEqualIgnoringCase(result["us"]["messaging"], "green");
        }
Esempio n. 13
0
        public void Device_d_GetDeviceInfo()
        {
            var result = client.GetDeviceInfo(deviceType, "csharp1");

            StringAssert.AreEqualIgnoringCase("updatedinfo", result["deviceInfo"]["description"]);
        }
Esempio n. 14
0
        public void DeviceType_b_Get()
        {
            var result = client.GetDeviceType("CsharpTestType");

            StringAssert.AreEqualIgnoringCase("CsharpTestType", result["id"]);
        }
Esempio n. 15
0
        public void CommitCmdShouldTrimAuthor(string input, string expected)
        {
            var actual = _gitModule.CommitCmd(false, author: input);

            StringAssert.AreEqualIgnoringCase(expected, actual);
        }
Esempio n. 16
0
        public void GetSchemaNamingContext(string domain, string expected)
        {
            var de = this.discoveryServices.GetSchemaNamingContext(domain);

            StringAssert.AreEqualIgnoringCase(expected, de.GetPropertyString("distinguishedName"));
        }
Esempio n. 17
0
        public void CommitCmdTests(bool amend, bool signOff, string author, bool useExplicitCommitMessage, bool noVerify, bool gpgSign, string gpgKeyId, string expected)
        {
            var actual = _gitModule.CommitCmd(amend, signOff, author, useExplicitCommitMessage, noVerify, gpgSign, gpgKeyId);

            StringAssert.AreEqualIgnoringCase(expected, actual);
        }
Esempio n. 18
0
 public void GetForestNameDnsFromDn(string dn, string expected)
 {
     StringAssert.AreEqualIgnoringCase(expected, discoveryServices.GetForestNameDns(dn));
 }
Esempio n. 19
0
        public void ProcessContentWithHtmlFlavorShouldProcessAppRelativeUrls()
        {
            var result = m_filter.ProcessContent(@"<a href=""~/relative-path"">Hello World</a>", "html");

            StringAssert.AreEqualIgnoringCase(@"<a href=""/OrchardLocal/relative-path"">Hello World</a>", result);
        }
Esempio n. 20
0
 public void GetDomainControllerFromDN(string dn, string expected)
 {
     StringAssert.AreEqualIgnoringCase(expected, discoveryServices.GetDomainControllerFromDN(dn));
 }
Esempio n. 21
0
        public void ProcessContentWithUnsupportedFlavorShouldNotProcessAppRelativeUrls()
        {
            var result = m_filter.ProcessContent(@"<a href=""~/relative-path"">Hello World</a>", "text");

            StringAssert.AreEqualIgnoringCase(@"<a href=""~/relative-path"">Hello World</a>", result);
        }
 public void testMostPopularArtistByYear2008()
 {
     StringAssert.AreEqualIgnoringCase("Say Anything", Program.MostPopularArtistByYear("2008"));
 }
Esempio n. 23
0
        public void ThenStatusCodeShouldBe(string statusCode)
        {
            var response = _restHelper.GetResponse();

            StringAssert.AreEqualIgnoringCase(statusCode, response.StatusCode.ToString());
        }
 public void testMostPopularArtistByYear2014()
 {
     StringAssert.AreEqualIgnoringCase("ODESZA", Program.MostPopularArtistByYear("2014"));
 }
Esempio n. 25
0
        public void ThenResponseUriShouldBe(string responseUri)
        {
            var response = _restHelper.GetResponse();

            StringAssert.AreEqualIgnoringCase(responseUri, response.ResponseUri.ToString());
        }
Esempio n. 26
0
        public void ShouldNotPrintLogsForStatusCommand()
        {
            string cliOut = CLITestHelper.CLITest(new[] { "status" });

            StringAssert.AreEqualIgnoringCase("NonExistent\r\n", cliOut);
        }
Esempio n. 27
0
        public void CheckResouceIsOverridden([Values(true, false)] bool useAapt2)
        {
            AssertHasDevices();
            AssertAaptSupported(useAapt2);

            var library = new XamarinAndroidLibraryProject()
            {
                ProjectName      = "Library1",
                AndroidResources =
                {
                    new AndroidItem.AndroidResource(() => "Resources\\values\\strings2.xml")
                    {
                        TextContent = () => @"<?xml version=""1.0"" encoding=""utf-8""?>
<resources>
	<string name=""hello_me"">Click Me! One</string>
</resources>",
                    },
                },
            };
            var library2 = new XamarinAndroidLibraryProject()
            {
                ProjectName      = "Library2",
                AndroidResources =
                {
                    new AndroidItem.AndroidResource(() => "Resources\\values\\strings2.xml")
                    {
                        TextContent = () => @"<?xml version=""1.0"" encoding=""utf-8""?>
<resources>
	<string name=""hello_me"">Click Me! Two</string>
</resources>",
                    },
                },
            };
            var app = new XamarinAndroidApplicationProject()
            {
                PackageName = "Xamarin.ResourceTest",
                References  =
                {
                    new BuildItem.ProjectReference("..\\Library1\\Library1.csproj"),
                    new BuildItem.ProjectReference("..\\Library2\\Library2.csproj"),
                },
            };

            library.AndroidUseAapt2      =
                library2.AndroidUseAapt2 =
                    app.AndroidUseAapt2  = useAapt2;
            app.LayoutMain = app.LayoutMain.Replace("@string/hello", "@string/hello_me");
            using (var l1 = CreateDllBuilder(Path.Combine("temp", TestName, library.ProjectName)))
                using (var l2 = CreateDllBuilder(Path.Combine("temp", TestName, library2.ProjectName)))
                    using (var b = CreateApkBuilder(Path.Combine("temp", TestName, app.ProjectName))) {
                        b.ThrowOnBuildFailure = false;
                        string apiLevel;
                        app.TargetFrameworkVersion = b.LatestTargetFrameworkVersion(out apiLevel);
                        app.AndroidManifest        = $@"<?xml version=""1.0"" encoding=""utf-8""?>
<manifest xmlns:android=""http://schemas.android.com/apk/res/android"" android:versionCode=""1"" android:versionName=""1.0"" package=""{app.PackageName}"">
	<uses-sdk android:minSdkVersion=""24"" android:targetSdkVersion=""{apiLevel}"" />
	<application android:label=""${{PROJECT_NAME}}"">
	</application >
</manifest> ";
                        Assert.IsTrue(l1.Build(library, doNotCleanupOnUpdate: true), $"Build of {library.ProjectName} should have suceeded.");
                        Assert.IsTrue(l2.Build(library2, doNotCleanupOnUpdate: true), $"Build of {library2.ProjectName} should have suceeded.");
                        b.BuildLogFile = "build1.log";
                        Assert.IsTrue(b.Build(app, doNotCleanupOnUpdate: true), $"Build of {app.ProjectName} should have suceeded.");
                        b.BuildLogFile = "install1.log";
                        Assert.IsTrue(b.Install(app, doNotCleanupOnUpdate: true), "Install should have suceeded.");
                        AdbStartActivity($"{app.PackageName}/{app.JavaPackageName}.MainActivity");
                        WaitForPermissionActivity(Path.Combine(Root, builder.ProjectDirectory, "permission-logcat.log"));
                        WaitForActivityToStart(app.PackageName, "MainActivity",
                                               Path.Combine(Root, builder.ProjectDirectory, "startup-logcat.log"), 15);
                        XDocument ui   = GetUI();
                        XElement  node = ui.XPathSelectElement($"//node[contains(@resource-id,'myButton')]");
                        StringAssert.AreEqualIgnoringCase("Click Me! One", node.Attribute("text").Value, "Text of Button myButton should have been \"Click Me! One\"");
                        b.BuildLogFile = "clean.log";
                        Assert.IsTrue(b.Clean(app, doNotCleanupOnUpdate: true), "Clean should have suceeded.");

                        app = new XamarinAndroidApplicationProject()
                        {
                            PackageName = "Xamarin.ResourceTest",
                            References  =
                            {
                                new BuildItem.ProjectReference("..\\Library1\\Library1.csproj"),
                                new BuildItem.ProjectReference("..\\Library2\\Library2.csproj"),
                            },
                        };

                        library2.References.Add(new BuildItem.ProjectReference("..\\Library1\\Library1.csproj"));
                        app.AndroidUseAapt2        = useAapt2;
                        app.LayoutMain             = app.LayoutMain.Replace("@string/hello", "@string/hello_me");
                        app.TargetFrameworkVersion = b.LatestTargetFrameworkVersion(out apiLevel);
                        app.AndroidManifest        = $@"<?xml version=""1.0"" encoding=""utf-8""?>
<manifest xmlns:android=""http://schemas.android.com/apk/res/android"" android:versionCode=""1"" android:versionName=""1.0"" package=""{app.PackageName}"">
	<uses-sdk android:minSdkVersion=""24"" android:targetSdkVersion=""{apiLevel}"" />
	<application android:label=""${{PROJECT_NAME}}"">
	</application >
</manifest> ";
                        b.BuildLogFile             = "build.log";
                        Assert.IsTrue(b.Build(app, doNotCleanupOnUpdate: true), $"Build of {app.ProjectName} should have suceeded.");
                        b.BuildLogFile = "install.log";
                        Assert.IsTrue(b.Install(app, doNotCleanupOnUpdate: true), "Install should have suceeded.");
                        AdbStartActivity($"{app.PackageName}/{app.JavaPackageName}.MainActivity");
                        WaitForPermissionActivity(Path.Combine(Root, builder.ProjectDirectory, "permission-logcat.log"));
                        WaitForActivityToStart(app.PackageName, "MainActivity",
                                               Path.Combine(Root, builder.ProjectDirectory, "startup-logcat.log"), 15);
                        ui   = GetUI();
                        node = ui.XPathSelectElement($"//node[contains(@resource-id,'myButton')]");
                        StringAssert.AreEqualIgnoringCase("Click Me! One", node.Attribute("text").Value, "Text of Button myButton should have been \"Click Me! One\"");
                    }
        }
Esempio n. 28
0
        public void VersionCodeTests(bool seperateApk, string abis, string versionCode, bool useLegacy, string versionCodePattern, string versionCodeProperties, bool shouldBuild, string expectedVersionCode)
        {
            var proj = new XamarinAndroidApplicationProject()
            {
                IsRelease = true,
            };

            proj.SetProperty("Foo", "1");
            proj.SetProperty(proj.ReleaseProperties, KnownProperties.AndroidCreatePackagePerAbi, seperateApk);
            if (!string.IsNullOrEmpty(abis))
            {
                proj.SetProperty(proj.ReleaseProperties, KnownProperties.AndroidSupportedAbis, abis);
            }
            if (!string.IsNullOrEmpty(versionCodePattern))
            {
                proj.SetProperty(proj.ReleaseProperties, "AndroidVersionCodePattern", versionCodePattern);
            }
            else
            {
                proj.RemoveProperty(proj.ReleaseProperties, "AndroidVersionCodePattern");
            }
            if (!string.IsNullOrEmpty(versionCodeProperties))
            {
                proj.SetProperty(proj.ReleaseProperties, "AndroidVersionCodeProperties", versionCodeProperties);
            }
            else
            {
                proj.RemoveProperty(proj.ReleaseProperties, "AndroidVersionCodeProperties");
            }
            if (useLegacy)
            {
                proj.SetProperty(proj.ReleaseProperties, "AndroidUseLegacyVersionCode", true);
            }
            proj.AndroidManifest = proj.AndroidManifest.Replace("android:versionCode=\"1\"", $"android:versionCode=\"{versionCode}\"");
            using (var builder = CreateApkBuilder(Path.Combine("temp", TestName), false, false)) {
                builder.ThrowOnBuildFailure = false;
                Assert.AreEqual(shouldBuild, builder.Build(proj), shouldBuild ? "Build should have succeeded." : "Build should have failed.");
                if (!shouldBuild)
                {
                    return;
                }
                var        abiItems      = seperateApk ? abis.Split(';') : new string[1];
                var        expectedItems = expectedVersionCode.Split(';');
                XNamespace aNS           = "http://schemas.android.com/apk/res/android";
                Assert.AreEqual(abiItems.Length, expectedItems.Length, "abis parameter should have matching elements for expected");
                for (int i = 0; i < abiItems.Length; i++)
                {
                    var path       = seperateApk ? Path.Combine("android", abiItems[i], "AndroidManifest.xml") : Path.Combine("android", "manifest", "AndroidManifest.xml");
                    var manifest   = builder.Output.GetIntermediaryAsText(Root, path);
                    var doc        = XDocument.Parse(manifest);
                    var nsResolver = new XmlNamespaceManager(new NameTable());
                    nsResolver.AddNamespace("android", "http://schemas.android.com/apk/res/android");
                    var m = doc.XPathSelectElement("/manifest") as XElement;
                    Assert.IsNotNull(m, "no manifest element found");
                    var vc = m.Attribute(aNS + "versionCode");
                    Assert.IsNotNull(vc, "no versionCode attribute found");
                    StringAssert.AreEqualIgnoringCase(expectedItems[i], vc.Value,
                                                      $"Version Code is incorrect. Found {vc.Value} expect {expectedItems[i]}");
                }
            }
        }
 public void StorageHasCorrectKey()
 {
     StringAssert.AreEqualIgnoringCase("HKEY_CURRENT_USER\\" + testKeyName, storage.StorageKey.Name);
 }
Esempio n. 30
0
 public void ThenAPIShouldReturnSuccessHTTPResponseCodeAlongWithTheBoardName()
 {
     StringAssert.AreEqualIgnoringCase("true", response.IsSuccessful.ToString());
 }