public void TestGetIdentifiersForYears_04() { // Test that artefacts are returned even if some years are irrelevant string[] identifiers = DublinCoreReader.GetIdentifiersForYears(new string[] { "2015", "1901", "1902" }); Assert.That(identifiers.Length == 1); Assert.That(identifiers[0] == "DeerMan"); }
public void TestGetIdentifiersForYears_01() { // Test that an artefact for a specific year is returned string[] identifiers = DublinCoreReader.GetIdentifiersForYears(new string[] { "2015" }); Assert.That(identifiers.Length == 1); Assert.That(identifiers[0] == "DeerMan"); }
public void TestGetIdentifiersForYears_02() { // Test that artefacts for many years are returned string[] identifiers = DublinCoreReader.GetIdentifiersForYears(new string[] { "2015", "2016" }); Assert.That(identifiers.Length == 2); Assert.That(identifiers[0] == "DeerMan"); Assert.That(identifiers[1] == "TestMonk"); }
/// <summary> /// Executed once user has finished their selection of relevant attributes /// </summary> public void DoneAttributeSelect() { List <string> activeAttributes = new List <string> (); for (int i = 0; i < attributeParent.childCount; i++) { Toggle curToggle = attributeParent.GetChild(i).GetComponent <Toggle>(); if (curToggle.isOn) { activeAttributes.Add(attributeParent.GetChild(i).GetComponentInChildren <Text>().text); } } string[] activeAttrArray = activeAttributes.ToArray(); //need to convert to array to account for DCReader, need list cause don't know how many attrs will be active string[] attributeIdentifiers; switch (browseMode) { case "Creator": attributeIdentifiers = DublinCoreReader.GetIdentifiersForCreators(activeAttrArray); break; case "Contributor": attributeIdentifiers = DublinCoreReader.GetIdentifiersForContributors(activeAttrArray); break; case "Date": attributeIdentifiers = DublinCoreReader.GetIdentifiersForYears(activeAttrArray); break; case "Subject": attributeIdentifiers = DublinCoreReader.GetIdentifiersForSubjects(activeAttrArray); break; default: attributeIdentifiers = null; break; } if (attributeIdentifiers.Length > 0) { BrowseCont.ImportArtefacts(attributeIdentifiers); } gameObject.SetActive(false); //turns panel off once query has been committed }
public void TestGetIdentifiersForYears_03() { // Test that artefacts are not returned if the year(s) are irrelevant string[] identifiers = DublinCoreReader.GetIdentifiersForYears(new string[] { "1900", "1901", "1902" }); Assert.That(identifiers.Length == 0); }