mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05:00

* Revert "Add git blame entry (#2226)" This reverts commit 239286737d15cb84a893703ee5a8b33a2d67ad3d. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit 34fb4cca2aa78deb84d4cbc359992a7c6bba7ea5.
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using Bit.Core.Models.Api.Request.Accounts;
|
|
using Bit.IntegrationTestCommon.Factories;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Xunit;
|
|
|
|
namespace Bit.Identity.IntegrationTest.Controllers
|
|
{
|
|
public class AccountsControllerTests : IClassFixture<IdentityApplicationFactory>
|
|
{
|
|
private readonly IdentityApplicationFactory _factory;
|
|
|
|
public AccountsControllerTests(IdentityApplicationFactory factory)
|
|
{
|
|
_factory = factory;
|
|
}
|
|
|
|
[Fact]
|
|
public async Task PostRegister_Success()
|
|
{
|
|
var context = await _factory.RegisterAsync(new RegisterRequestModel
|
|
{
|
|
Email = "test+register@email.com",
|
|
MasterPasswordHash = "master_password_hash"
|
|
});
|
|
|
|
Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
|
|
|
|
var database = _factory.GetDatabaseContext();
|
|
var user = await database.Users
|
|
.SingleAsync(u => u.Email == "test+register@email.com");
|
|
|
|
Assert.NotNull(user);
|
|
}
|
|
}
|
|
}
|