Esempio n. 1
0
        public void IsValid()
        {
            var userName = "******";
            var email    = "*****@*****.**";

            var createUserCommand = new CreateUserCommand(userName, email);

            Assert.AreEqual(false, createUserCommand.HasNotifications());
        }
        public void EmailIsValid()
        {
            CreateUserService createUserService;
            var createUserCommand = new CreateUserCommand("teste", "*****@*****.**");

            var options = new DbContextOptionsBuilder <AvatarContext>()
                          .UseInMemoryDatabase(databaseName: "Email valid to create new user")
                          .Options;


            using (var context = new AvatarContext(options))
            {
                var userRepository = new UserRepository(context);

                //Act
                createUserService = new CreateUserService(createUserCommand, userRepository);
            }

            Assert.IsFalse(createUserCommand.HasNotifications());
        }