aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting/BL
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-23 20:15:36 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-02-23 20:15:36 +0200
commit17612c08da93c75d4c941a643bc7602c18f351d8 (patch)
tree7fb879ef52d5460149b199f752279c3889cb5271 /Software/Visual_Studio/Tango.UnitTesting/BL
parentd7c8a8e9a6320ade6098e0d8e182c7ada4e30a97 (diff)
downloadTango-17612c08da93c75d4c941a643bc7602c18f351d8.tar.gz
Tango-17612c08da93c75d4c941a643bc7602c18f351d8.zip
Implemented auto DTO generation.
Implemented mapping of DTO <=> Observables. Organization of unit tests. Removed DELETED from ADDRESS & CONTACT.
Diffstat (limited to 'Software/Visual_Studio/Tango.UnitTesting/BL')
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/BL/DTO_TST.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.UnitTesting/BL/DTO_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/BL/DTO_TST.cs
new file mode 100644
index 000000000..58a05ee83
--- /dev/null
+++ b/Software/Visual_Studio/Tango.UnitTesting/BL/DTO_TST.cs
@@ -0,0 +1,42 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL;
+using Tango.BL.Builders;
+using Tango.BL.DTO;
+using System.Data.Entity;
+using DeepEqual.Syntax;
+
+namespace Tango.UnitTesting.BL
+{
+ [TestClass]
+ [TestCategory("BL - DTO")]
+ public class DTO_TST
+ {
+ /// <summary>
+ /// Creates the DTO from observable and map DTO to observable test.
+ /// </summary>
+ [TestMethod]
+ public void Create_DTO_From_Observable_and_Map_DTO_To_Observable()
+ {
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ var config = new ConfigurationBuilder(db).SetFirst().WithIdsPacks().Build();
+ var configDTO = ConfigurationDTO.FromObservable(config);
+
+ Assert.IsTrue(configDTO.Equals(config));
+
+ configDTO.MapToObservable(config);
+
+ Assert.IsTrue(configDTO.Equals(config));
+
+ config = configDTO.ToObservable();
+
+ Assert.IsTrue(configDTO.Equals(config));
+ }
+ }
+ }
+}