Exemplo n.º 1
0
 public void GetCollections()
 {
     string[] collectIdentifiers = CollectionReader.GetIdentifiersForCollections();
     for (int i = 0; i < collectIdentifiers.Length; i++)
     {
         InstantCollectButton(collectIdentifiers[i]);
     }
 }
Exemplo n.º 2
0
    public void GetIdentifiersForArtefactsInCollectionWithIdentifier()
    {
        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForCollections();
        string[] artefactIdentifiers   = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier(collectionIdentifiers[0]);

        Assert.That(artefactIdentifiers[0] == "Evans Bay Wharf");
        Assert.That(artefactIdentifiers[1] == "Cog Wheel Evans Bay");
        Assert.That(artefactIdentifiers[2] == "Evans Boat House");
        Assert.That(artefactIdentifiers[3] == "Cricket Monument");
        Assert.That(artefactIdentifiers[4] == "Doll Head");
    }
Exemplo n.º 3
0
    public void TestGetIdentifiersForCollections()
    {
        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForCollections();

        Assert.That(collectionIdentifiers[0] == "P14C3H01D3R-00");
        Assert.That(collectionIdentifiers[1] == "P14C3H01D3R-01");
        Assert.That(collectionIdentifiers[2] == "P14C3H01D3R-02");
        Assert.That(collectionIdentifiers[3] == "P14C3H01D3R-03");
        Assert.That(collectionIdentifiers[4] == "P14C3H01D3R-04");
        Assert.That(collectionIdentifiers[5] == "P14C3H01D3R-05");
    }
Exemplo n.º 4
0
    public void GetCollectionMetadataWithIdentifier()
    {
        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForCollections();
        Dictionary <string, string[]> collectionMetadata = CollectionReader.GetCollectionMetadataWithIdentifier(collectionIdentifiers [0]);

        Assert.That(collectionMetadata ["identifier"] [0] == collectionIdentifiers [0]);
        Assert.That(collectionMetadata ["title"][0] == "Photogrammetry Test Scans");
        Assert.That(collectionMetadata ["creator"][0] == "Ryan Achten");
        Assert.That(collectionMetadata ["date"][0] == "29/11/2015");
        Assert.That(collectionMetadata ["description"][0] == "A museum is distinguished by a collection of often unique objects that forms the core of its activities for exhibitions, education, research, etc.");
        Assert.That(collectionMetadata ["subject"][0] == "Photogrammetry");
        Assert.That(collectionMetadata ["coverage"] [0] == "Evan's Bay");
        Assert.That(collectionMetadata ["coverage"] [1] == "Basin Reserve");
        Assert.That(collectionMetadata ["extent"] [0] == "5");
    }
Exemplo n.º 5
0
    public void TestInstantiateWithCollectionReaderDictionary()
    {
        // Get the list of collection identifiers, and subsequently the list of artefact identifiers for the first collection
        string[] collectionIdentifiers = CollectionReader.GetIdentifiersForCollections();
        string[] artefactIdentifiers   = CollectionReader.GetIdentifiersForArtefactsInCollectionWithIdentifier(collectionIdentifiers [0]);

        // Now get the transform data for the first artefact in the first collection, and attempt to construct a VerticeTransform with the data
        Dictionary <string, Dictionary <string, float> > transformData = CollectionReader.GetTransformForArtefactWithIdentifierInCollection(collectionIdentifiers [0], artefactIdentifiers [0]);
        VerticeTransform transform = new VerticeTransform(transformData);

        Assert.That(transform.position.x == 40.01599f);
        Assert.That(transform.position.y == -11.58916f);
        Assert.That(transform.position.z == 184.2516f);
        Assert.That(transform.rotation.x == 1.0f);
        Assert.That(transform.rotation.y == 1.0f);
        Assert.That(transform.rotation.z == 1.0f);
        Assert.That(transform.rotation.w == 1.0f);
        Assert.That(transform.scale.x == 1.0f);
        Assert.That(transform.scale.y == 1.0f);
        Assert.That(transform.scale.z == 1.0f);
    }
Exemplo n.º 6
0
    public void TestSaveLocationChanges()
    {
        // Check that, when the save location is changed, the two XML files a) can vary independently, and that b) the second file
        // is an extension of whatever data existed in the first file (i.e. that, in a sense, operations on the second file are precluded by
        // all of the operations that had occurred to establish the first file).

        CollectionWriter.EstablishNewDocument();

        // Create some data
        Dictionary <string, string[]>         descriptiveData = new Dictionary <string, string[]>();
        Dictionary <string, VerticeTransform> structuralData  = new Dictionary <string, VerticeTransform>();

        descriptiveData.Add("title", new string[] { "Test Title" });
        descriptiveData.Add("creator", new string[] { "Test Creator" });
        descriptiveData.Add("date", new string[] { "2016-10-20" });

        structuralData.Add("TEST-ARTEFACT-01", new VerticeTransform(Vector3.one, Quaternion.identity, Vector3.one));

        // Write data to the first file
        Paths.CollectionMetadata = Environment.CurrentDirectory + "/Assets/Scripts/Metadata/TestAssets/Collection_Writer_Test.xml";
        CollectionWriter.WriteCollectionWithIdentifer("TEST-COLLECTION-01", descriptiveData, structuralData);

        // Change location and save the new collection
        Paths.CollectionMetadata = Environment.CurrentDirectory + "/Assets/Scripts/Metadata/TestAssets/Collection_Writer_Test_02.xml";
        CollectionWriter.WriteCollectionWithIdentifer("TEST-COLLECTION-02", descriptiveData, structuralData);

        // Check that the first file has only one collection
        CollectionReader.LoadXmlFromFile(Environment.CurrentDirectory + "/Assets/Scripts/Metadata/TestAssets/Collection_Writer_Test.xml");
        string[] collectionIdentifiers_01 = CollectionReader.GetIdentifiersForCollections();
        Assert.That(collectionIdentifiers_01.Length == 1);

        // Now check that the second file has two
        CollectionReader.LoadXmlFromFile(Paths.CollectionMetadata);
        string[] collectionIdentifiers_02 = CollectionReader.GetIdentifiersForCollections();
        Assert.That(collectionIdentifiers_02.Length == 2);

        // Tidy up (the second file will be deleted in TearDown)
        File.Delete(Environment.CurrentDirectory + "/Assets/Scripts/Metadata/TestAssets/Collection_Writer_Test.xml");
    }