Exemple #1
0
        public void Should_Show_Error_When_Email_Null_Or_Empty(string email)
        {
            UserCreateCommand userCreateCommand = new UserCreateCommand(1, Guid.NewGuid().ToString(), _faker.Person.FullName, email);

            userCreateCommand.Validate();

            Assert.True(!userCreateCommand.IsValid());
            Assert.True(userCreateCommand.Errors?.FirstOrDefault(x => x == "E-mail is required") != null);
        }
Exemple #2
0
        public void Should_Show_Error_When_IdProfile_Invalid(int idProfile)
        {
            UserCreateCommand userCreateCommand = new UserCreateCommand(idProfile, Guid.NewGuid().ToString(), _faker.Person.FullName, _faker.Person.Email);

            userCreateCommand.Validate();

            Assert.True(!userCreateCommand.IsValid());
            Assert.True(userCreateCommand.Errors?.FirstOrDefault(x => x == "Profile is required") != null);
        }