Esempio n. 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();
 }
Esempio n. 3
0
        public void TwoUsersShouldBeDiff()
        {
            User user1 = new User("tisciencia");
            User user2 = new User("vintem");

            user1.Equals(user2).Should().Be(false);
        }
Esempio n. 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;
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 public void QuestionShouldBeToUserTiago()
 {
     User tiago = new User("Tiago");
     Question question = new Question(null, tiago, "Olá tudo bem?");
     question.To.Should().Be(tiago);
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 public void QuestionShouldBeAnonym()
 {
     User tiago = new User("Tiago");
     Question question = new Question(null, tiago, "Olá tudo bem?");
     question.IsAnonymous.Should().Be(true);
 }
Esempio n. 10
0
 public Question(User to, string message)
     : this(null, to, message)
 {
 }