Ejemplo n.º 1
0
 public void TestGetIdentifiersForCreators_02()
 {
     string[] values      = DublinCoreReader.GetValuesForCreator();
     string[] identifiers = DublinCoreReader.GetIdentifiersForCreators(new string[] { values[1] });
     Assert.That(identifiers.Length == 1);
     Assert.That(identifiers [0] == "TestMonk");
 }
Ejemplo n.º 2
0
 public void TestGetIdentifiersForCreators_03()
 {
     string[] values      = DublinCoreReader.GetValuesForCreator();
     string[] identifiers = DublinCoreReader.GetIdentifiersForCreators(values);
     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
    }
Ejemplo n.º 4
0
 public void TestGetIdentifiersForCreators_NoResults()
 {
     string[] identifiers = DublinCoreReader.GetIdentifiersForCreators(new string[] { "No one" });
     Assert.That(identifiers.Length == 0);
 }