public void NorthwindRemovingTest()
        {
            var instance = new DatabaseTests();

            var actual = instance.Tests3();

            Assert.AreEqual(actual, 91);
        }
        public void NorthwindAddingTest()
        {
            var instance = new DatabaseTests();

            var actual = instance.Tests2();

            Assert.AreEqual(actual, 92);
        }
        public void NorthwindLengthTest()
        {
            var instance = new DatabaseTests();

            var actual = instance.ProductTest();

            Assert.AreEqual(actual, 77);
        }
Esempio n. 4
0
        public void TestReadingDocument()
        {
            string xml =
                @"<?xml version=""1.0""?>

<metadata
  xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
  xsi:schemaLocation=""http://example.org/myapp/ http://example.org/myapp/schema.xsd""
  xmlns:dc=""http://purl.org/dc/elements/1.1/""
  xmlns:dcterms=""http://purl.org/dc/terms/"">

  <dc:title>
    UKOLN
  </dc:title>
  <dcterms:alternative>
    UK Office for Library and Information Networking
  </dcterms:alternative>
  <dc:subject>
    national centre, network information support, library
    community, awareness, research, information services,public
    library networking, bibliographic management, distributed
    library systems, metadata, resource discovery,
    conferences,lectures, workshops
  </dc:subject>
  <dc:subject xsi:type=""dcterms:DDC"">
    062
  </dc:subject>
  <dc:subject xsi:type=""dcterms:UDC"">
    061(410)
  </dc:subject>
  <dc:description>
    UKOLN is a national focus of expertise in digital information
    management. It provides policy, research and awareness services
    to the UK library, information and cultural heritage communities.
    UKOLN is based at the University of Bath.
  </dc:description>
  <dc:description xml:lang=""fr"">
    UKOLN est un centre national d'expertise dans la gestion de l'information
    digitale.
  </dc:description>
  <dc:publisher>
    UKOLN, University of Bath
  </dc:publisher>
  <dcterms:isPartOf xsi:type=""dcterms:URI"">
    http://www.bath.ac.uk/
  </dcterms:isPartOf>
  <dc:identifier xsi:type=""dcterms:URI"">
    http://www.ukoln.ac.uk/
  </dc:identifier>
  <dcterms:modified xsi:type=""dcterms:W3CDTF"">
    2001-07-18
  </dcterms:modified>
  <dc:format xsi:type=""dcterms:IMT"">
    text/html
  </dc:format>
</metadata>";

            var fi = new FileInfo(Path.Combine(TestContext.CurrentContext.TestDirectory, "dublinTestReading.xml"));

            File.WriteAllText(fi.FullName, xml);

            var doc = XDocument.Load(fi.FullName);

            var def = new DublinCoreDefinition();

            def.LoadFrom(doc.Root);

            Assert.IsTrue(DatabaseTests.AreBasicallyEquals("UKOLN", def.Title));
            Assert.IsTrue(DatabaseTests.AreBasicallyEquals("UK Office for Library and Information Networking", def.Alternative));
            Assert.IsTrue(DatabaseTests.AreBasicallyEquals(@"national centre, network information support, library
    community, awareness, research, information services,public
    library networking, bibliographic management, distributed
    library systems, metadata, resource discovery,
    conferences,lectures, workshops", def.Subject));

            Assert.IsTrue(DatabaseTests.AreBasicallyEquals(@"UKOLN is a national focus of expertise in digital information
    management. It provides policy, research and awareness services
    to the UK library, information and cultural heritage communities.
    UKOLN is based at the University of Bath.", def.Description));

            Assert.IsTrue(DatabaseTests.AreBasicallyEquals("UKOLN, University of Bath", def.Publisher));
            StringAssert.AreEqualIgnoringCase("http://www.bath.ac.uk/", def.IsPartOf.AbsoluteUri);
            StringAssert.AreEqualIgnoringCase("http://www.ukoln.ac.uk/", def.Identifier.AbsoluteUri);
            Assert.IsTrue(DatabaseTests.AreBasicallyEquals(new DateTime(2001, 07, 18), def.Modified));
        }
Esempio n. 5
0
 public static void ClassCleanup()
 {
     DatabaseTests.DeleteDatabase();
 }
Esempio n. 6
0
 public static void ClassInitialize(TestContext testContext)
 {
     DatabaseTests.ResetDatabase();
 }