Esempio n. 1
0
        private void ArrangeMessageDTORecipient(
            IMessagePublishParameters parameters,
            bool isRecipientValid,
            bool isRecipientIdValid,
            bool isRecipientScreenNameValid)
        {
            var recipient           = A.Fake <IUserDTO>();
            var recipientId         = TestHelper.GenerateRandomLong();
            var recipientScreenName = TestHelper.GenerateString();

            parameters.CallsTo(x => x.Recipient).Returns(recipient);
            parameters.CallsTo(x => x.RecipientId).Returns(recipientId);
            parameters.CallsTo(x => x.RecipientScreenName).Returns(recipientScreenName);

            _fakeUserQueryValidator.CallsTo(x => x.CanUserBeIdentified(recipient)).Returns(isRecipientValid);
            _fakeUserQueryValidator.CallsTo(x => x.IsUserIdValid(recipientId)).Returns(isRecipientIdValid);
            _fakeUserQueryValidator.CallsTo(x => x.IsScreenNameValid(recipientScreenName)).Returns(isRecipientScreenNameValid);
        }
        private void ArrangeMessageDTORecipient(
            IMessagePublishParameters parameters,
            bool isRecipientValid,
            bool isRecipientIdValid,
            bool isRecipientScreenNameValid)
        {
            var recipient = A.Fake<IUserDTO>();
            var recipientId = TestHelper.GenerateRandomLong();
            var recipientScreenName = TestHelper.GenerateString();

            parameters.CallsTo(x => x.Recipient).Returns(recipient);
            parameters.CallsTo(x => x.RecipientId).Returns(recipientId);
            parameters.CallsTo(x => x.RecipientScreenName).Returns(recipientScreenName);

            _fakeUserQueryValidator.CallsTo(x => x.CanUserBeIdentified(recipient)).Returns(isRecipientValid);
            _fakeUserQueryValidator.CallsTo(x => x.IsUserIdValid(recipientId)).Returns(isRecipientIdValid);
            _fakeUserQueryValidator.CallsTo(x => x.IsScreenNameValid(recipientScreenName)).Returns(isRecipientScreenNameValid);
        }
        private void ArrangeMessagePublishParameterText(IMessagePublishParameters parameters, bool doesTextExists, bool textContainsChars)
        {
            string text = doesTextExists ? textContainsChars ? TestHelper.GenerateString() : string.Empty : null;

            parameters.CallsTo(x => x.Text).Returns(text);
        }
Esempio n. 4
0
        private void ArrangeMessagePublishParameterText(IMessagePublishParameters parameters, bool doesTextExists, bool textContainsChars)
        {
            string text = doesTextExists ? textContainsChars ? TestHelper.GenerateString() : string.Empty : null;

            parameters.CallsTo(x => x.Text).Returns(text);
        }