Exemple #1
0
        public void TwoUsersShouldBeEqual()
        {
            User user1 = new User("tisciencia");
            User user2 = new User("tisciencia");

            user1.Equals(user2).Should().Be(true);
        }
 public void GivenThereIsAUserCalledVintem(string username)
 {
     _currentUser = new User(username);
     var userRepository = new UserDAO();
     userRepository.Add(_currentUser);
     userRepository.Commit();
 }
Exemple #3
0
        public void TwoUsersShouldBeDiff()
        {
            User user1 = new User("tisciencia");
            User user2 = new User("vintem");

            user1.Equals(user2).Should().Be(false);
        }
Exemple #4
0
        public Question(User from, User to, string message)
        {
            if (to == null)
                throw new ArgumentException("The parameter 'User to' can not be null");
            if (!IsMessageValid(message))
                throw new ArgumentException("Iinvalid message");

            ID = Guid.NewGuid();
            DateCreated = DateTime.Now;
            To = to;
            From = from;
            Message = message;
        }
        public void QuestionsRepository_FromUser_should_return_questions_answered_from_a_specific_user()
        {
            User vintem = new User("vintem");
            User outro = new User("outro");
            _questionsRepository.Add(new Question(vintem, "Question1")
                                         {
                                             Answer = "Test"
                                         });
            _questionsRepository.Add(new Question(outro, "Question2")
            {
                Answer = "Test"
            });
            _questionsRepository.Add(new Question(vintem, "Question1"));

            var questions = _questionsRepository.AllAnsweredByUser("vintem");
            Assert.AreEqual(1, questions.Count);
        }
 public void QuestionShouldNotBeAnonym()
 {
     User tiago = new User("Tiago");
     User vintem = new User("Vintem");
     Question question = new Question(vintem, tiago, "Olá tudo bem?");
     question.IsAnonymous.Should().Be(false);
 }
 public void QuestionShouldBeToUserTiago()
 {
     User tiago = new User("Tiago");
     Question question = new Question(null, tiago, "Olá tudo bem?");
     question.To.Should().Be(tiago);
 }
 public void QuestionShouldBeFromUserVintemToAnyUser()
 {
     User tiago = new User("Tiago");
     User vintem = new User("Vintem");
     Question question = new Question(vintem, tiago, "Olá tudo bem?");
     question.From.Should().Be(vintem);
 }
 public void QuestionShouldBeAnonym()
 {
     User tiago = new User("Tiago");
     Question question = new Question(null, tiago, "Olá tudo bem?");
     question.IsAnonymous.Should().Be(true);
 }
Exemple #10
0
 public Question(User to, string message)
     : this(null, to, message)
 {
 }