aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-10-24 06:40:07 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-10-24 06:40:07 +0300
commitadaddad79352c156303e9178a6f172a18af50cd2 (patch)
tree0ff2a59c3007bc9c40b7b543a9a2afe32dbc3d45 /Software/Visual_Studio/Tango.UnitTesting
parent2d803e9410cd383d8e66c300f86fe0f7374c81ea (diff)
downloadTango-adaddad79352c156303e9178a6f172a18af50cd2.tar.gz
Tango-adaddad79352c156303e9178a6f172a18af50cd2.zip
Refactored DataStore Proto.
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/DataStore/DataStore_TST.cs34
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj6
2 files changed, 37 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/DataStore/DataStore_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DataStore/DataStore_TST.cs
index 1428aa210..594c8d7f8 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/DataStore/DataStore_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/DataStore/DataStore_TST.cs
@@ -11,6 +11,9 @@ using Tango.DataStore;
using Tango.DataStore.Lite;
using Tango.Core.IO;
using Tango.DataStore.EF;
+using Tango.PMR.Stubs;
+using Tango.Transport;
+using Tango.DataStore.Remote;
namespace Tango.UnitTesting.DataStore
{
@@ -32,6 +35,27 @@ namespace Tango.UnitTesting.DataStore
Run_Test(new EFDataStoreManager());
}
+ [TestMethod]
+ public void Remote_Data_Store_Working()
+ {
+ CalculateRequest calc = new CalculateRequest()
+ {
+ A = 10,
+ B = 15,
+ };
+
+ RemoteDataStoreGetResponse response = new RemoteDataStoreGetResponse();
+ response.ProtoObject = DataStoreProtoObject.FromMessage(calc);
+
+ byte[] data = GenericMessageSerializer.Serialize<RemoteDataStoreGetResponse>(response, PMR.Integration.GenericMessageProtocol.Bson);
+
+ RemoteDataStoreGetResponse des = GenericMessageSerializer.Deserialize<RemoteDataStoreGetResponse>(data, PMR.Integration.GenericMessageProtocol.Bson);
+
+ CalculateRequest cc = des.ProtoObject.Message as CalculateRequest;
+
+ Assert.AreEqual<CalculateRequest>(calc, cc);
+ }
+
private void Run_Test(IDataStoreManager manager)
{
IDataStoreCollection collection = manager.GetCollection("TEST");
@@ -72,7 +96,13 @@ namespace Tango.UnitTesting.DataStore
Assert.AreEqual<byte>(value[0], 255);
}
- Assert.IsTrue(collection.Count() == 6);
+ {
+ collection.Put<CalculateRequest>("calc", new CalculateRequest() { A = 10, B = 15 });
+ CalculateRequest value = collection.Get<CalculateRequest>("calc");
+ Assert.AreEqual<CalculateRequest>(value, new CalculateRequest() { A = 10, B = 15 });
+ }
+
+ Assert.IsTrue(collection.Count() == 7);
Assert.ThrowsException<NotSupportedException>(() => collection.Put<DataStore_TST>("somekey", this));
@@ -82,7 +112,7 @@ namespace Tango.UnitTesting.DataStore
collection.Delete("float");
Assert.ThrowsException<KeyNotFoundException>(() => collection.Get<float>("float"));
- Assert.IsTrue(collection.Count() == 4);
+ Assert.IsTrue(collection.Count() == 5);
collection.DeleteAll();
Assert.IsTrue(collection.Count() == 0);
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
index 0371c1cca..b24079da0 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
+++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
@@ -221,6 +221,10 @@
<Project>{fa96bc0c-4055-475c-9dcc-70a5a9436b10}</Project>
<Name>Tango.DataStore.Lite</Name>
</ProjectReference>
+ <ProjectReference Include="..\Tango.DataStore.Remote\Tango.DataStore.Remote.csproj">
+ <Project>{29448f3c-9b3e-4da6-8555-46a8b9a6b3aa}</Project>
+ <Name>Tango.DataStore.Remote</Name>
+ </ProjectReference>
<ProjectReference Include="..\Tango.DataStore\Tango.DataStore.csproj">
<Project>{e0364dfa-0721-4637-9d32-9d22aac109d6}</Project>
<Name>Tango.DataStore</Name>
@@ -319,7 +323,7 @@
<Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file