public async Task ItThrowsAConfigurationExceptionIfTheCallbackUrlConfigSettingIsMissing()
{
configurationManagerMock = MockRepository.GenerateMock<IConfigurationManager>();
var appSettingsMock = MockRepository.GenerateMock<IAppSettings>();
configurationManagerMock.Expect(mock => mock.AppSettings)
.Return(appSettingsMock);
appSettingsMock.Expect(mock => mock.Get(FirstTimeAuthenticator.APP_KEY_EMAIL_CONFIRMATION_CALLBACK_URL))
.Throw(new Exception());
firstTimeAuthenticator = new FirstTimeAuthenticator(
gamingGroupSaverMock,
applicationUserManagerMock,
configurationManagerMock,
dataContextMock);
string exceptionMessage = string.Empty;
try
{
await firstTimeAuthenticator.CreateGamingGroupAndSendEmailConfirmation(applicationUser, registrationSource);
}
catch (ConfigurationException expectedException)
{
exceptionMessage = expectedException.Message;
}
Assert.AreEqual(exceptionMessage, "Missing app setting with key: emailConfirmationCallbackUrl");
}