aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs')
-rw-r--r--Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs b/Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs
index 8a2314858..d15b1c7a9 100644
--- a/Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs
+++ b/Software/Visual_Studio_v2/Tango.UnitTests/DAL/Mongo.cs
@@ -25,6 +25,14 @@ namespace Tango.UnitTests.DAL
repo.Insert(org1).GetAwaiter().GetResult();
+ OrganizationEntity orgDuplicate = new OrganizationEntity();
+ orgDuplicate.Name = org1.Name;
+
+ Assert.ThrowsException<MongoDB.Driver.MongoWriteException>(() =>
+ {
+ repo.Insert(orgDuplicate).GetAwaiter().GetResult();
+ });
+
Assert.IsNotNull(org1.ID);
var org2 = repo.GetAsync(x => x.ID == org1.ID).GetAwaiter().GetResult().FirstOrDefault();