private void BrowseMode(string browseType) { string[] browseAttributes; switch (browseType) { case "Creator": browseAttributes = DublinCoreReader.GetValuesForCreator(); break; case "Contributor": browseAttributes = DublinCoreReader.GetValuesForContributor(); break; case "Date": browseAttributes = DublinCoreReader.GetAllYears(); break; case "Subject": browseAttributes = DublinCoreReader.GetValuesForSubject(); break; default: browseAttributes = null; break; } Array.Sort(browseAttributes); browseMode = browseType; InstantAttributes(browseAttributes); }
public void TestGetIdentifiersForContributors_01() { // Test that passing all contributors returns all artefacts string[] values = DublinCoreReader.GetValuesForContributor(); string[] identifiers = DublinCoreReader.GetIdentifiersForContributors(values); Assert.That(identifiers.Length == 2); }
public void TestGetIdentifiersForContributors_02() { // Test set semantics (i.e. values[1] and values[3] are contributors for the same artefact, so should return one result) string[] values = DublinCoreReader.GetValuesForContributor(); string[] identifiers = DublinCoreReader.GetIdentifiersForContributors(new string[] { values [1], values [3] }); Assert.That(identifiers.Length == 1); Assert.That(identifiers[0] == "DeerMan"); }
public void TestGetValuesForContributor() { string[] values = DublinCoreReader.GetValuesForContributor(); Assert.That(values.Length == 4); Assert.That(values [0] == "Another Contributor"); Assert.That(values [1] == "Doprah"); Assert.That(values [2] == "Some Contributor"); Assert.That(values [3] == "Yet Another Contributor"); }
public void TestGetIdentifiersForContributors_03() { // Test that a Contributor appearing in two artefacts returns two identifiers string[] values = DublinCoreReader.GetValuesForContributor(); string[] identifiers = DublinCoreReader.GetIdentifiersForContributors(new string[] { values [0] }); Assert.That(identifiers.Length == 2); Assert.That(identifiers[0] == "DeerMan"); Assert.That(identifiers[1] == "TestMonk"); }