public void QuestionAnswerShouldBeAnswered() { Question question = new Question(new User(), "Olá tudo bem?"); question.Answer = "Sim, obrigado."; question.IsAnswered.Should().Be(true); }
public void QuestionMessageShouldBeInvalidWithMessage256() { char[] charArrayOverMaxLength = new char[MESSAGE_MAX_LENGTH + 1]; for (int i = 0; i < MESSAGE_MAX_LENGTH + 1; i++) charArrayOverMaxLength[i] = '.'; string messageOverMaxLength = new string(charArrayOverMaxLength); Question question = new Question(new User(), messageOverMaxLength); }
public void GivenTheUserVintemHasTheFollowingQuestions(Table table) { _expectedQuestions = new List<Question>(); foreach (var row in table.Rows) { var question = new Question(_currentUser, row["Question"]) { Answer = row["Answer"]}; _expectedQuestions.Add(question); } _mock.Setup(x => x.AllAnsweredByUser(It.IsAny<string>())).Returns(_expectedQuestions); }
public ActionResult Index(string username, UserProfile profile) { var userProfile = Users.Load(user => user.Username == username); if (ModelState.IsValid) { Question newQuestion; if (Request.IsAuthenticated) { User userFrom = Users.Load(user => user.Username == User.Identity.Name); newQuestion = new Question(userFrom, userProfile, profile.NewQuestion); } else newQuestion = new Question(userProfile, profile.NewQuestion); Questions.Add(newQuestion); Questions.Commit(); } TempData["mensagem"] = Messages.QuestionPostedWithSuccess; return RedirectToAction("Index"); }
public void QuestionObjectShouldBeDiff() { Question question1 = new Question(new User(), "Olá tudo bem?"); Question question2 = new Question(new User(), "Olá tudo bem?"); question1.Equals(question2).Should().Be(false); }
public void QuestionMessageShouldBeValidWithMessage255() { char[] charArrayMaxLength = new char[MESSAGE_MAX_LENGTH]; for (int i = 0; i < MESSAGE_MAX_LENGTH; i++) charArrayMaxLength[i] = '.'; string messageMaxLength = new string(charArrayMaxLength); Question question = new Question(new User(), messageMaxLength); question.Message.Length.Should().Be(MESSAGE_MAX_LENGTH); }
public void QuestionMessageShouldBeValid() { Question question = new Question(new User(), "Olá tudo bem?"); question.Message.Should().Be("Olá tudo bem?"); }
public void QuestionMessageShouldBeInvalidWhenToNull() { Question question = new Question(null, "Olá tudo bem?"); }
public void QuestionMessageShouldBeInvalidWhenNull() { Question question = new Question(new User(), null); }
public void QuestionMessageShouldBeInvalidWhenEmpty() { Question question = new Question(new User(), ""); }
public void QuestionAnswerShouldBeNotAnswered() { Question question = new Question(new User(), "Olá tudo bem?"); question.IsAnswered.Should().Be(false); }
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); }