commit 20f17fe1b36b2500c495b1aa270135b911861775
Author: Tomáš Orlovský <orlovsky@students.zcu.cz>
Date:   Fri May 28 16:50:46 2021 +0200

    Completed tests of CreateNewArea @testFull

diff --git a/Leuze.Tests.Modules.Goal/GoalDefinitionAreasTests.cs b/Leuze.Tests.Modules.Goal/GoalDefinitionAreasTests.cs
index f1f1617..fa59ecb 100644
--- a/Leuze.Tests.Modules.Goal/GoalDefinitionAreasTests.cs
+++ b/Leuze.Tests.Modules.Goal/GoalDefinitionAreasTests.cs
@@ -51,13 +51,13 @@ namespace Leuze.Tests.Modules.Goal
             _semaphore.Release();
         }
 
-        //TODO: change user
+        
         [Fact]
         public async void CreateNewAreaTestTL()
         {
             await _semaphore.WaitAsync();
 
-            var AuthenticationStateProviderMock = await TestUtils.AuthenticationMock(DatabaseFixture, TestUtils.adminName);
+            var AuthenticationStateProviderMock = await TestUtils.AuthenticationMock(DatabaseFixture, TestUtils.TLName);
             var handler = new CreateNewArea.Handler(
                 DatabaseFixture.Services.GetRequiredService<IGlobalDefinitionAreaRepository>(),
                 AuthenticationStateProviderMock.Object,
@@ -69,13 +69,13 @@ namespace Leuze.Tests.Modules.Goal
             _semaphore.Release();
         }
 
-        //TODO: change user
+        
         [Fact]
         public async void CreateNewAreaTestMA()
         {
             await _semaphore.WaitAsync();
 
-            var AuthenticationStateProviderMock = await TestUtils.AuthenticationMock(DatabaseFixture, TestUtils.adminName);
+            var AuthenticationStateProviderMock = await TestUtils.AuthenticationMock(DatabaseFixture, TestUtils.MAName);
             var handler = new CreateNewArea.Handler(
                 DatabaseFixture.Services.GetRequiredService<IGlobalDefinitionAreaRepository>(),
                 AuthenticationStateProviderMock.Object,
@@ -87,14 +87,42 @@ namespace Leuze.Tests.Modules.Goal
             _semaphore.Release();
         }
 
-        //private async Task<Mock<AuthenticatedUserProvider>> AuthenticationMock(string username)
-        //{
-        //    var user = await DatabaseFixture.UserManager.FindByEmailAsync(username);
-        //    (user != null).Should().BeTrue();
+        [Fact]
+        public async void CreateNewAreaTestOverlap()
+        {
+            await _semaphore.WaitAsync();
+
+            var AuthenticationStateProviderMock = await TestUtils.AuthenticationMock(DatabaseFixture, TestUtils.TLName);
+            var handler = new CreateNewArea.Handler(
+                DatabaseFixture.Services.GetRequiredService<IGlobalDefinitionAreaRepository>(),
+                AuthenticationStateProviderMock.Object,
+                DatabaseFixture.Services.GetRequiredService<IDomainUserRepository>());
+            var result = await handler.Handle(new CreateNewArea.Command(DateTime.Today, DateTime.Today.AddDays(1), 0.0), default);
+
+            result.IsSuccess.Should().BeTrue();
+
+            result = await handler.Handle(new CreateNewArea.Command(DateTime.Today.AddDays(1), DateTime.Today.AddDays(2), 0.0), default);
+
+            result.IsSuccess.Should().BeFalse();
+
+            _semaphore.Release();
+        }
+
+        [Fact]
+        public async void CreateNewAreaTestWrongRange()
+        {
+            await _semaphore.WaitAsync();
+
+            var AuthenticationStateProviderMock = await TestUtils.AuthenticationMock(DatabaseFixture, TestUtils.MAName);
+            var handler = new CreateNewArea.Handler(
+                DatabaseFixture.Services.GetRequiredService<IGlobalDefinitionAreaRepository>(),
+                AuthenticationStateProviderMock.Object,
+                DatabaseFixture.Services.GetRequiredService<IDomainUserRepository>());
+            var result = await handler.Handle(new CreateNewArea.Command(DateTime.Today.AddDays(1), DateTime.Today, 0.0), default);
 
-        //    var AuthenticationStateProviderMock = new Mock<AuthenticatedUserProvider>(Mock.Of<AuthenticationStateProvider>());
-        //    AuthenticationStateProviderMock.Setup(e => e.RequiredUserId).Returns(user.Id);
-        //    return AuthenticationStateProviderMock;
-        //}
+            result.IsSuccess.Should().BeFalse();
+
+            _semaphore.Release();
+        }
     }
 }
diff --git a/Leuze.sln b/Leuze.sln
index fc33a04..438b0c2 100644
--- a/Leuze.sln
+++ b/Leuze.sln
@@ -61,93 +61,64 @@ Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
-		Test|Any CPU = Test|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{B316B6E4-2898-4F23-9D96-97A90F41BFDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B316B6E4-2898-4F23-9D96-97A90F41BFDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{B316B6E4-2898-4F23-9D96-97A90F41BFDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{B316B6E4-2898-4F23-9D96-97A90F41BFDC}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B316B6E4-2898-4F23-9D96-97A90F41BFDC}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{B316B6E4-2898-4F23-9D96-97A90F41BFDC}.Test|Any CPU.Build.0 = Test|Any CPU
 		{66EEF1C2-9476-4FF6-86F7-2C1035C7DC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{66EEF1C2-9476-4FF6-86F7-2C1035C7DC66}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{66EEF1C2-9476-4FF6-86F7-2C1035C7DC66}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{66EEF1C2-9476-4FF6-86F7-2C1035C7DC66}.Release|Any CPU.Build.0 = Release|Any CPU
-		{66EEF1C2-9476-4FF6-86F7-2C1035C7DC66}.Test|Any CPU.ActiveCfg = Debug|Any CPU
-		{66EEF1C2-9476-4FF6-86F7-2C1035C7DC66}.Test|Any CPU.Build.0 = Debug|Any CPU
 		{D4908C8E-6488-457B-B045-4D769D9ACA76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D4908C8E-6488-457B-B045-4D769D9ACA76}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D4908C8E-6488-457B-B045-4D769D9ACA76}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D4908C8E-6488-457B-B045-4D769D9ACA76}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D4908C8E-6488-457B-B045-4D769D9ACA76}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{D4908C8E-6488-457B-B045-4D769D9ACA76}.Test|Any CPU.Build.0 = Test|Any CPU
 		{B443BE7B-7A75-4BAE-872B-85C13D528C3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{B443BE7B-7A75-4BAE-872B-85C13D528C3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{B443BE7B-7A75-4BAE-872B-85C13D528C3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{B443BE7B-7A75-4BAE-872B-85C13D528C3C}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B443BE7B-7A75-4BAE-872B-85C13D528C3C}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{B443BE7B-7A75-4BAE-872B-85C13D528C3C}.Test|Any CPU.Build.0 = Test|Any CPU
 		{3926F2A1-547E-48E4-B87F-29C21E7FC625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{3926F2A1-547E-48E4-B87F-29C21E7FC625}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3926F2A1-547E-48E4-B87F-29C21E7FC625}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{3926F2A1-547E-48E4-B87F-29C21E7FC625}.Release|Any CPU.Build.0 = Release|Any CPU
-		{3926F2A1-547E-48E4-B87F-29C21E7FC625}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{3926F2A1-547E-48E4-B87F-29C21E7FC625}.Test|Any CPU.Build.0 = Test|Any CPU
 		{674168B3-2D4C-4746-A1A7-FE890BD59C1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{674168B3-2D4C-4746-A1A7-FE890BD59C1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{674168B3-2D4C-4746-A1A7-FE890BD59C1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{674168B3-2D4C-4746-A1A7-FE890BD59C1A}.Release|Any CPU.Build.0 = Release|Any CPU
-		{674168B3-2D4C-4746-A1A7-FE890BD59C1A}.Test|Any CPU.ActiveCfg = Debug|Any CPU
-		{674168B3-2D4C-4746-A1A7-FE890BD59C1A}.Test|Any CPU.Build.0 = Debug|Any CPU
 		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{D037B7D3-CA28-4EBD-9E2F-3F3D347950CF}.Test|Any CPU.Build.0 = Test|Any CPU
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{8ECAEA01-61F3-402D-B94E-E54FC0C94C8E}.Test|Any CPU.Build.0 = Test|Any CPU
 		{D271989D-921D-486B-929C-6BBF1EC0EED4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D271989D-921D-486B-929C-6BBF1EC0EED4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{D271989D-921D-486B-929C-6BBF1EC0EED4}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D271989D-921D-486B-929C-6BBF1EC0EED4}.Release|Any CPU.Build.0 = Release|Any CPU
-		{D271989D-921D-486B-929C-6BBF1EC0EED4}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{D271989D-921D-486B-929C-6BBF1EC0EED4}.Test|Any CPU.Build.0 = Test|Any CPU
 		{C49CA0F7-C0C2-4FCE-98C4-4E42765B4405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C49CA0F7-C0C2-4FCE-98C4-4E42765B4405}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C49CA0F7-C0C2-4FCE-98C4-4E42765B4405}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C49CA0F7-C0C2-4FCE-98C4-4E42765B4405}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C49CA0F7-C0C2-4FCE-98C4-4E42765B4405}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{C49CA0F7-C0C2-4FCE-98C4-4E42765B4405}.Test|Any CPU.Build.0 = Test|Any CPU
 		{C6F9EFF2-30DA-4FA9-AEFF-4957F0260267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C6F9EFF2-30DA-4FA9-AEFF-4957F0260267}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C6F9EFF2-30DA-4FA9-AEFF-4957F0260267}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C6F9EFF2-30DA-4FA9-AEFF-4957F0260267}.Release|Any CPU.Build.0 = Release|Any CPU
-		{C6F9EFF2-30DA-4FA9-AEFF-4957F0260267}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{C6F9EFF2-30DA-4FA9-AEFF-4957F0260267}.Test|Any CPU.Build.0 = Test|Any CPU
 		{BAAC1AB6-C671-408C-94EF-96459D5403DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BAAC1AB6-C671-408C-94EF-96459D5403DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{BAAC1AB6-C671-408C-94EF-96459D5403DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{BAAC1AB6-C671-408C-94EF-96459D5403DD}.Release|Any CPU.Build.0 = Release|Any CPU
-		{BAAC1AB6-C671-408C-94EF-96459D5403DD}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{BAAC1AB6-C671-408C-94EF-96459D5403DD}.Test|Any CPU.Build.0 = Test|Any CPU
 		{BEBFBA58-BCB7-4F44-9247-EAAAE748176A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BEBFBA58-BCB7-4F44-9247-EAAAE748176A}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{BEBFBA58-BCB7-4F44-9247-EAAAE748176A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{BEBFBA58-BCB7-4F44-9247-EAAAE748176A}.Release|Any CPU.Build.0 = Release|Any CPU
-		{BEBFBA58-BCB7-4F44-9247-EAAAE748176A}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{BEBFBA58-BCB7-4F44-9247-EAAAE748176A}.Test|Any CPU.Build.0 = Test|Any CPU
 		{2824A507-5BBD-44B7-9F3A-643F29C7E597}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{2824A507-5BBD-44B7-9F3A-643F29C7E597}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{2824A507-5BBD-44B7-9F3A-643F29C7E597}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{2824A507-5BBD-44B7-9F3A-643F29C7E597}.Release|Any CPU.Build.0 = Release|Any CPU
-		{2824A507-5BBD-44B7-9F3A-643F29C7E597}.Test|Any CPU.ActiveCfg = Test|Any CPU
-		{2824A507-5BBD-44B7-9F3A-643F29C7E597}.Test|Any CPU.Build.0 = Test|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/tests/Leuze.Tests.Configuration/Utilities.cs b/tests/Leuze.Tests.Configuration/Utilities.cs
index 38b4bf4..d4040b0 100644
--- a/tests/Leuze.Tests.Configuration/Utilities.cs
+++ b/tests/Leuze.Tests.Configuration/Utilities.cs
@@ -22,12 +22,8 @@ namespace Leuze.Tests.Configuration
             List<Assembly> loadedAssemblies = new List<Assembly>();
 
             string workingDirectory = Environment.CurrentDirectory;
-#if TEST
-            string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.Parent.FullName;
-#else
-            string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.Parent.Parent.Parent.FullName;
-#endif
 
+            string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.Parent.FullName;
 
             // Loop through all dll files in directory
             foreach (FileInfo file in new DirectoryInfo(Path.Combine(projectDirectory, "src", "Presentation", "Leuze.Modules", "net5.0")).GetFiles("*.dll"))
