Skip to content

Commit 5a1ee22

Browse files
committed
all discovery endpoints tested
1 parent b179946 commit 5a1ee22

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

Examples/ServiceExamples/Scripts/ExampleDiscoveryV1.cs

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ private void Start()
5959
// Log.Debug("ExampleDiscoveryV1", "Failed to get environment");
6060

6161
// AddEnvironment
62-
Log.Debug("ExampleDiscoveryV1", "Attempting to add environment");
63-
if (!m_Discovery.AddEnvironment(OnAddEnvironment, "unity-testing-AddEnvironment-do-not-delete-until-active", "Testing addEnvironment in Unity SDK. Please do not delete this environment until the status is 'active'", 0))
64-
Log.Debug("ExampleDiscoveryV1", "Failed to add environment");
62+
//Log.Debug("ExampleDiscoveryV1", "Attempting to add environment");
63+
//if (!m_Discovery.AddEnvironment(OnAddEnvironment, "unity-testing-AddEnvironment-do-not-delete-until-active", "Testing addEnvironment in Unity SDK. Please do not delete this environment until the status is 'active'", 0))
64+
// Log.Debug("ExampleDiscoveryV1", "Failed to add environment");
6565

6666
//// Get Configurations
6767
//Log.Debug("ExampleDiscoveryV1", "Attempting to get configurations");
@@ -77,8 +77,24 @@ private void Start()
7777
//Log.Debug("ExampleDiscoveryV1", "Attempting to get collections");
7878
//if (!m_Discovery.GetCollections(OnGetCollections, m_DefaultEnvironmentID))
7979
// Log.Debug("ExampleDiscovery", "Failed to get collections");
80+
81+
// Add Collection
82+
//Log.Debug("ExampleDiscoveryV1", "Attempting to add collection");
83+
//if (!m_Discovery.AddCollection(OnAddCollection, "8a73b0aa-d8f3-418f-8341-f4ddc336c363", m_CreatedCollectionName, m_CreatedCollectionDescription, "c9b51b49-e6cf-480a-be9f-5b5e06d5f2d2"))
84+
// Log.Debug("ExampleDiscovery", "Failed to add collection");
85+
86+
// Get Collection
87+
//Log.Debug("ExampleDiscoveryV1", "Attempting to get collection");
88+
//if (!m_Discovery.GetCollection(OnGetCollection, "8a73b0aa-d8f3-418f-8341-f4ddc336c363", "9388fbf8-38f6-44b1-81d2-9b4bade6b9c2"))
89+
// Log.Debug("ExampleDiscovery", "Failed to get collection");
90+
91+
// Delete Collection
92+
//Log.Debug("ExampleDiscoveryV1", "Attempting to delete collection {0}", m_CreatedCollectionID);
93+
//if (!m_Discovery.DeleteCollection(OnDeleteCollection, "8a73b0aa-d8f3-418f-8341-f4ddc336c363", "9388fbf8-38f6-44b1-81d2-9b4bade6b9c2"))
94+
// Log.Debug("ExampleDiscovery", "Failed to add collection");
8095
}
8196

97+
#region Check State
8298
private void CheckState()
8399
{
84100
Log.Debug("ExampleDiscoveryV1", "Attempting to get environment state");
@@ -111,7 +127,17 @@ private void BeginDeleteCycle()
111127
Invoke("TestDeleteCollection", 1f);
112128
Invoke("TestDeleteConfiguration", 2f);
113129
}
130+
#endregion
131+
132+
private void TestDeleteEnvironment()
133+
{
134+
// DeleteEnvironment
135+
Log.Debug("ExampleDiscoveryV1", "Attempting to delete environment {0}", m_CreatedEnvironmentID);
136+
if (!m_Discovery.DeleteEnvironment(OnDeleteEnvironment, m_CreatedEnvironmentID))
137+
Log.Debug("ExampleDiscoveryV1", "Failed to delete environment");
138+
}
114139

140+
#region Configuration
115141
private void TestPreviewConfiguration()
116142
{
117143
Log.Debug("ExampleDiscoveryV1", "Attempting to preview configuration");
@@ -127,22 +153,16 @@ private void TestDeleteConfiguration()
127153
Log.Debug("ExampleDiscoveryV1", "Failed to delete configuration");
128154
}
129155

130-
private void TestDeleteEnvironment()
131-
{
132-
// DeleteEnvironment
133-
Log.Debug("ExampleDiscoveryV1", "Attempting to delete environment {0}", m_CreatedEnvironmentID);
134-
if (!m_Discovery.DeleteEnvironment(OnDeleteEnvironment, m_CreatedEnvironmentID))
135-
Log.Debug("ExampleDiscoveryV1", "Failed to delete environment");
136-
}
137-
138156
private void TestAddConfiguration()
139157
{
140158
// Add Configuration
141159
Log.Debug("ExampleDiscoveryV1", "Attempting to add configuration");
142160
if (!m_Discovery.AddConfiguration(OnAddConfiguration, m_CreatedEnvironmentID, m_ConfigurationJsonPath))
143161
Log.Debug("ExampleDiscoveryV1", "Failed to add configuration");
144162
}
163+
#endregion
145164

165+
#region Collection
146166
private void TestAddCollection()
147167
{
148168
// Add Collection
@@ -166,7 +186,9 @@ private void TestDeleteCollection()
166186
if (!m_Discovery.DeleteCollection(OnDeleteCollection, m_CreatedEnvironmentID, m_CreatedCollectionID))
167187
Log.Debug("ExampleDiscovery", "Failed to add collection");
168188
}
189+
#endregion
169190

191+
#region Documents
170192
private void TestAddDocument()
171193
{
172194
Log.Debug("ExampleDiscoveryV1", "Attempting to add document");
@@ -194,6 +216,7 @@ private void TestDeleteDocument()
194216
if (!m_Discovery.DeleteDocument(OnDeleteDocument, m_CreatedEnvironmentID, m_CreatedCollectionID, m_CreatedDocumentID))
195217
Log.Debug("ExampleDiscovery", "Failed to delete document");
196218
}
219+
#endregion
197220

198221
private void TestQuery()
199222
{
@@ -358,7 +381,7 @@ private void OnGetCollection(Collection resp, string data)
358381
Log.Debug("ExampleDiscoveryV1", "Collection: {0}, {1}", resp.collection_id, resp.name);
359382

360383

361-
TestAddDocument();
384+
//TestAddDocument();
362385
}
363386
else
364387
{
@@ -373,7 +396,7 @@ private void OnAddCollection(CollectionRef resp, string data)
373396
Log.Debug("ExampleDiscoveryV1", "Collection: {0}, {1}", resp.collection_id, resp.name);
374397
m_CreatedCollectionID = resp.collection_id;
375398

376-
TestGetCollection();
399+
//TestGetCollection();
377400
}
378401
else
379402
{

0 commit comments

Comments
 (0)