public async Task ShouldRequireMinimumFields() { var ownerId = await GetRandomOwner(); var storeId = await GetRandomStore(ownerId); var command = new CreateStoreEmployeeCommand("", "", "", ""); FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>(); }
public async Task ShouldRequireUniqueUsername() { var ownerId = await GetRandomOwner(); var storeId = await GetRandomStore(ownerId); await SendAsync(new CreateStoreEmployeeCommand(storeId, "pedro", "username", "aStrong")); var command = new CreateStoreEmployeeCommand(storeId, "alexander", "username", "aStrongPass"); FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>(); }