Exemple #1
0
        public void Should_have_error_when_User_outside_room()
        {
            var message = MessagingMessageMockData.UserOutsideRoomWithouMessage().SerializeMessage();
            var result  = _messageService.HandleRequest(socketId, message);

            Assert.That(result[0].Event, Is.EqualTo(EventEnum.Error));
        }
Exemple #2
0
        public void Should_Not_have_error_when_User_inside_room_with_message_numbers()
        {
            var message = MessagingMessageMockData.UserInsideRoomWithMessageNumbersOK().SerializeMessage();
            var result  = _messageService.HandleRequest(socketId, message);

            Assert.That(result[0].Event, Is.EqualTo(EventEnum.Error));
        }
Exemple #3
0
        public void Should_have_error_when_Message_with_user_is_null()
        {
            var message = MessagingMessageMockData.MessageWithouUser().SerializeMessage();
            var result  = _messageService.HandleRequest(socketId, message);

            Assert.That(result[0].Event, Is.EqualTo(EventEnum.Error));
        }
Exemple #4
0
        public void Should_Not_have_error_when_User_inside_room_with_message_special_chars()
        {
            var message = MessagingMessageMockData.UserInsideRoomWithMessageSpecialCharOK();

            validator.ShouldNotHaveValidationErrorFor(x => x.MessageText, message);
        }
Exemple #5
0
        public void Should_have_error_when_user_inside_room_message_201_chars()
        {
            var message = MessagingMessageMockData.UserInsideRoomWithMessage201Chars();

            validator.ShouldHaveValidationErrorFor(x => x.MessageText, message);
        }
Exemple #6
0
        public void Should_have_error_when_User_outside_room_with_message()
        {
            var message = MessagingMessageMockData.UserOutsideRoomWithMessage();

            validator.ShouldHaveValidationErrorFor(x => x.User.IdActiveRoom, message);
        }
Exemple #7
0
        public void Should_have_error_when_Message_with_user_is_null()
        {
            var message = MessagingMessageMockData.MessageWithouUser();

            validator.ShouldHaveValidationErrorFor(x => x.User, message);
        }
Exemple #8
0
        public void Should_have_error_when_Event_is_null()
        {
            var message = MessagingMessageMockData.EventNull();

            validator.ShouldHaveValidationErrorFor(x => x.Event, message);
        }
Exemple #9
0
        public void Should_Not_have_error_when_User_inside_room_other_fields()
        {
            var message = MessagingMessageMockData.UserInsideRoomWithMessageOtherFieldsOK();

            validator.ShouldNotHaveValidationErrorFor(x => x.MessageText, message);
        }