diff --git a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000037.cs b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000037.cs index afadbc820..5a621fe1d 100644 --- a/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000037.cs +++ b/src/SIL.LCModel/DomainServices/DataMigration/DataMigration7000037.cs @@ -7,8 +7,8 @@ using System; using System.IO; +using System.Net; using System.Text; -using System.Web; using System.Xml.Linq; using System.Xml.XPath; using SIL.LCModel.Utils; @@ -66,7 +66,7 @@ private bool FixExternalLinks(XElement xel, string projectName) value = kFwUrlPrefix.Substring(0, 1) + value; if (!value.StartsWith(kFwUrlPrefix)) continue; - string query = HttpUtility.UrlDecode(value.Substring(kFwUrlPrefix.Length)); + string query = WebUtility.UrlDecode(value.Substring(kFwUrlPrefix.Length)); string[] rgsProps = query.Split(new char[] {'&'}, StringSplitOptions.RemoveEmptyEntries); string database = null; int idxDatabase = -1; @@ -130,7 +130,7 @@ private bool FixExternalLinks(XElement xel, string projectName) if (!fChange) continue; - value = kFwUrlPrefix + HttpUtility.UrlEncode(string.Join("&", rgsProps)); + value = kFwUrlPrefix + WebUtility.UrlEncode(string.Join("&", rgsProps)); if (attrLink.Value != value) { attrLink.Value = value; diff --git a/src/SIL.LCModel/SIL.LCModel.csproj b/src/SIL.LCModel/SIL.LCModel.csproj index 23d125937..e3ca684e5 100644 --- a/src/SIL.LCModel/SIL.LCModel.csproj +++ b/src/SIL.LCModel/SIL.LCModel.csproj @@ -108,10 +108,6 @@ - - - - diff --git a/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000037Tests.cs b/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000037Tests.cs index 8239e010d..5f6846519 100644 --- a/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000037Tests.cs +++ b/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000037Tests.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; -using System.Web; +using System.Net; using System.Xml.Linq; using System.Xml.XPath; using NUnit.Framework; @@ -122,7 +122,7 @@ private void CheckForValidLinkValue(string externalLink) } Assert.IsTrue(externalLink.StartsWith(FwUrlPrefix), "silfw link should start with " + FwUrlPrefix); - string query = HttpUtility.UrlDecode(externalLink.Substring(FwUrlPrefix.Length)); + string query = WebUtility.UrlDecode(externalLink.Substring(FwUrlPrefix.Length)); string[] rgsProps = query.Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries); string tool = null; Guid guid = Guid.Empty; diff --git a/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000040Tests.cs b/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000040Tests.cs index 8f5cf5310..c9f300501 100644 --- a/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000040Tests.cs +++ b/tests/SIL.LCModel.Tests/DomainServices/DataMigration/DataMigration7000040Tests.cs @@ -5,9 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Web; using System.Xml.Linq; -using System.Xml.XPath; using NUnit.Framework; using SIL.LCModel.Utils; @@ -23,8 +21,6 @@ namespace SIL.LCModel.DomainServices.DataMigration [TestFixture] public class DataMigration7000040Tests : DataMigrationTestsBase { - private const string FwUrlPrefix = "silfw://localhost/link?"; - ///-------------------------------------------------------------------------------------- /// /// Test the migration from version 7000039 to 7000040. @@ -100,80 +96,5 @@ private void VerifyObjSur(IEnumerable osElements, int index, string gu Assert.That(objsur.Attribute("guid").Value, Is.EqualTo(guid)); Assert.That(objsur.Attribute("t").Value, Is.EqualTo("r")); } - - int m_cLinks; - List m_rgsOtherLinks = new List(); - - private void CollectionNonSilfwLinks(IDomainObjectDTORepository dtoRepos) - { - foreach (var dto in dtoRepos.AllInstancesWithValidClasses()) - { - string xml = dto.Xml; - Assert.IsTrue(xml.Contains("externalLink"), "Every object in the test has an externalLink"); - var dtoXML = XElement.Parse(xml); - foreach (var run in dtoXML.XPathSelectElements("//Run")) - { - var externalLinkAttr = run.Attribute("externalLink"); - if (externalLinkAttr != null) - { - string value = externalLinkAttr.Value; - if (value.StartsWith("http://") || value.StartsWith("libronixdls:")) - m_rgsOtherLinks.Add(value); - ++m_cLinks; - } - } - } - - } - - private void CheckForValidLinkValue(string externalLink) - { - int idxColon = externalLink.IndexOf(':'); - Assert.Greater(idxColon, 0, "links must have a colon to separate off the type of link"); - string linkType = externalLink.Substring(0, idxColon); - switch (linkType) - { - case "http": - case "libronixdls": - Assert.IsTrue(m_rgsOtherLinks.Contains(externalLink), - "Migration should not affect http or libronix links"); - return; - default: - Assert.AreEqual("silfw", linkType); - break; - } - Assert.IsTrue(externalLink.StartsWith(FwUrlPrefix), - "silfw link should start with " + FwUrlPrefix); - string query = HttpUtility.UrlDecode(externalLink.Substring(FwUrlPrefix.Length)); - string[] rgsProps = query.Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries); - string tool = null; - Guid guid = Guid.Empty; - for (int i = 0; i < rgsProps.Length; ++i) - { - string[] propPair = rgsProps[i].Split('='); - switch (propPair[0]) - { - case "app": - Assert.AreEqual("flex", propPair[1], "silfw link - app should equal \"flex\""); - break; - case "server": - Assert.That(propPair[1], Is.Null.Or.Empty, "silfw link - server should be empty"); - break; - case "database": - Assert.AreEqual("this$", propPair[1], "silfw link - database should equal \"this$\""); - break; - case "tool": - tool = propPair[1]; - break; - case "guid": - guid = new Guid(propPair[1]); - break; - default: - break; - } - } - Assert.That(tool, Is.Not.Null.And.Not.Empty, "silfw link - tool should have a value"); - Assert.AreNotEqual(Guid.Empty, guid, "silfw link - guid should have a value"); - } } } diff --git a/tests/SIL.LCModel.Tests/SIL.LCModel.Tests.csproj b/tests/SIL.LCModel.Tests/SIL.LCModel.Tests.csproj index 8c2fdc073..a6afe657f 100644 --- a/tests/SIL.LCModel.Tests/SIL.LCModel.Tests.csproj +++ b/tests/SIL.LCModel.Tests/SIL.LCModel.Tests.csproj @@ -24,10 +24,6 @@ This package provides unit tests for SIL.LCModel. - - - -