public void Create_EmptyintOnInput_ShoudThrowException() { User newUser = null; DomainException domainException = null; try { newUser = User.Create(new int(), "*****@*****.**", "ValidUsername", (int)UserRole.user, "Secretpassword", "salt"); } catch (Exception exception) { if (exception is DomainException ex) { domainException = ex; } } newUser.Should().BeNull(); domainException.Should().NotBeNull(); domainException.Code.Should().Be(DomainErrorCodes.EmptyId); }