public void GetResponseTo_Fails_CannotGetGroupId() { //Arrange var user = new User { SubscriptionStatus = UserType.StandardUser, State = ChatState.Standrard }; _mockVk .Setup(vk => vk.GetObjIdIdByLink(It.IsAny <Uri>())) .Returns((false, 0, null, PreferenceType.WrongLink)); var addNewAlarms = new Step2InputGroup(_mockDb.Object, _mockVk.Object); var userMessage = new Message { Chat = new Chat { Id = 123 }, Text = "https://vk.com/21jqofa" }; //Act var response = addNewAlarms.GetResponseTo(userMessage, user); //Assert Assert.That(response, Is.Not.Null); Assert.That(response.ChatId, Is.EqualTo(123)); Assert.That(response.Text, Is.EqualTo("Не удалось получть id группы\nВыбери что тебе нужно сделать:")); Assert.That(response.ReplyMarkup.GetType(), Is.EqualTo(typeof(ReplyKeyboardMarkup))); Assert.That(user.State, Is.EqualTo(ChatState.Standrard)); }
public void GetResponseTo_Success_CorrectUrlNotEmptyMessage() { //Arrange var user = new User { SubscriptionStatus = UserType.StandardUser, State = ChatState.Standrard }; _mockVk .Setup(vk => vk.GetObjIdIdByLink(It.IsAny <Uri>())) .Returns((true, 122121, "Group name", PreferenceType.VkGroup)); var addNewAlarms = new Step2InputGroup(_mockDb.Object, _mockVk.Object); var userMessage = new Message { Chat = new Chat { Id = 123 }, Text = "https://vk.com/21jqofa" }; //Act var response = addNewAlarms.GetResponseTo(userMessage, user); //Assert Assert.That(response, Is.Not.Null); Assert.That(response.ChatId, Is.EqualTo(123)); Assert.That(response.Text, Is.EqualTo("Введите слова или фразы через запятую, какие следует искать в этой группе. Например _однушка, перекопка, торты, аквариум, аренда_.")); Assert.That(response.ReplyMarkup.GetType(), Is.EqualTo(typeof(ReplyKeyboardRemove))); Assert.That(user.State, Is.EqualTo(ChatState.NewWordToGroupAdd)); }