Skip to content

Commit e6ba5fe

Browse files
committed
merge
2 parents 0f708d6 + ed21853 commit e6ba5fe

File tree

8 files changed

+28
-52
lines changed

8 files changed

+28
-52
lines changed

src/Server/Coderr.Server.App/Core/Invitations/CommandHandlers/IAccountService.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Server/Coderr.Server.App/Core/Invitations/CommandHandlers/InviteUserHandler.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
using System;
2-
using System.Configuration;
3-
using System.Linq;
1+
using System.Linq;
42
using System.Security;
5-
using System.Security.Claims;
63
using System.Threading.Tasks;
74
using codeRR.Server.Api.Core.Applications.Events;
85
using codeRR.Server.Api.Core.Invitations.Commands;
@@ -11,11 +8,9 @@
118
using codeRR.Server.App.Configuration;
129
using codeRR.Server.App.Core.Applications;
1310
using codeRR.Server.App.Core.Users;
14-
using codeRR.Server.Infrastructure.Configuration;
1511
using codeRR.Server.Infrastructure.Security;
1612
using Coderr.Server.PluginApi.Config;
1713
using DotNetCqs;
18-
using DotNetCqs.DependencyInjection;
1914
using Griffin.Container;
2015
using log4net;
2116

src/Server/Coderr.Server.SqlServer.Tests/codeRR.Server.SqlServer.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@
2222
<Reference Include="System.Configuration" />
2323
</ItemGroup>
2424

25+
<ItemGroup>
26+
<Folder Include="Core\Invitations\" />
27+
</ItemGroup>
28+
2529
</Project>

src/Server/Coderr.Server.Web.Tests/Helpers/xUnit/EnsureTestEnvironmentAttribute.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Server/Coderr.Server.Web.Tests/Tests/ConfigureApplicationPageTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public void Should_not_be_able_to_create_application_without_name_specified()
1616
var sut = new ConfigureApplicationPage(WebDriver)
1717
.CreateApplication(string.Empty);
1818

19+
//TODO: Verify error message
1920
sut.VerifyIsCurrentPage();
2021

2122
Logout();

src/Server/Coderr.Server.Web.Tests/WebTest.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
namespace codeRR.Server.Web.Tests
1515
{
1616
[TestCaseOrderer("codeRR.Server.Web.Tests.Helpers.xUnit.TestCaseOrderer", "codeRR.Server.Web.Tests")]
17-
//[EnsureTestEnvironment]
1817
public abstract class WebTest
1918
{
2019
private static readonly IisExpressHelper _iisExpress;
2120
private static readonly DatabaseManager _databaseManager = new DatabaseManager();
22-
private bool _disposed;
2321

2422
static WebTest()
2523
{
@@ -37,7 +35,6 @@ static WebTest()
3735
};
3836

3937
_iisExpress = new IisExpressHelper();
40-
EnsureTestEnvironmentAttribute.helper = _iisExpress;
4138
_iisExpress = new IisExpressHelper
4239
{
4340
ConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "applicationhost.config"),
@@ -48,12 +45,12 @@ static WebTest()
4845
_iisExpress.Start("codeRR.Server.Web");
4946

5047
TestData = new TestDataManager(_databaseManager.OpenConnection);
48+
WebDriver = DriverFactory.Create(BrowserType.Chrome);
49+
AppDomain.CurrentDomain.DomainUnload += (o, e) => { DisposeWebDriver(); };
5150
}
5251

5352
protected WebTest()
5453
{
55-
WebDriver = DriverFactory.Create(BrowserType.Chrome);
56-
AppDomain.CurrentDomain.DomainUnload += (o, e) => { Dispose(); };
5754

5855
TestData.ResetDatabase(_iisExpress.BaseUrl);
5956
}
@@ -62,13 +59,11 @@ protected WebTest()
6259

6360
public static TestDataManager TestData { get; }
6461

65-
public IWebDriver WebDriver { get; private set; }
62+
public static IWebDriver WebDriver { get; private set; }
6663

67-
public void Dispose()
64+
65+
private static void DisposeWebDriver()
6866
{
69-
if (_disposed)
70-
return;
71-
_disposed = true;
7267
try
7368
{
7469
WebDriver.Quit();
@@ -77,6 +72,7 @@ public void Dispose()
7772
catch
7873
{
7974
}
75+
8076
WebDriver.Dispose();
8177
}
8278

src/Server/Coderr.Server.Web/App_Start/Services/ServiceRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private QueueListener CreateQueueListener(IServiceLocator locator, string inboun
186186
};
187187
listener.PoisonMessageDetected += (sender, args) =>
188188
{
189-
Err.Report(args.Exception, new { args.Message });
189+
//Err.Report(args.Exception, new { args.Message });
190190
_log.Error(inboundQueueName + " Poison message: " + args.Message.Body, args.Exception);
191191
};
192192
listener.ScopeCreated += (sender, args) =>

src/Server/Coderr.Server.Web/Controllers/AccountController.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
using codeRR.Server.Api.Core.Invitations.Queries;
1515
using codeRR.Server.App.Configuration;
1616
using codeRR.Server.App.Core.Accounts;
17+
using codeRR.Server.Infrastructure;
1718
using codeRR.Server.Infrastructure.Configuration;
1819
using codeRR.Server.Infrastructure.Security;
20+
using codeRR.Server.SqlServer.Core.Accounts;
1921
using codeRR.Server.Web.Models.Account;
2022
using Coderr.Server.PluginApi.Config;
2123
using DotNetCqs;
@@ -95,6 +97,16 @@ public async Task<ActionResult> Accept(AcceptViewModel model)
9597
};
9698

9799
var identity = await _accountService.AcceptInvitation(this.ClaimsUser(), cmd);
100+
101+
//TODO: Remove hack.
102+
// HERE since the message queue starts to process the events
103+
// before we are done with them. We need some way to stack up the publishing
104+
// until the current handler is done.
105+
//
106+
// can't use a message handler since we need a result from the invitation accept.
107+
// so that we can construct a new identity
108+
_uow.SaveChanges();
109+
98110
if (identity == null)
99111
{
100112
ModelState.AddModelError("",
@@ -103,9 +115,9 @@ public async Task<ActionResult> Accept(AcceptViewModel model)
103115
return View(new AcceptViewModel());
104116
}
105117

106-
118+
107119
SignIn(identity);
108-
return Redirect("~/#/account/accepted");
120+
return RedirectToAction("UpdateSession", new { returnUrl = "/#/account/accepted" });
109121
}
110122

111123
public async Task<ActionResult> Activate(string id)
@@ -169,7 +181,7 @@ public async Task<ActionResult> Login(LoginViewModel model)
169181
return View(model);
170182
}
171183

172-
184+
173185
SignIn(principal);
174186

175187
if (model.ReturnUrl != null && model.ReturnUrl.StartsWith("/"))

0 commit comments

Comments
 (0)