Beispiel #1
0
        public void Get_NoParameters_MoreThanNoItems()
        {
            // Arrange
            HttpConversationServiceChannelFactory factory = new HttpConversationServiceChannelFactory();
            IConversationService service = factory.CreateChannel();

            // Act
            IServiceResponseWithResultData <IEnumerable <ConversationSummaryEntity> > actual = service.Get(new ServiceRequest <Guid>());

            // Assert
            Assert.IsTrue(actual.ResultData.Any());
        }
Beispiel #2
0
        public void DeleteConversation_TestConversationName_Succeeded()
        {
            // Arrange
            HttpConversationServiceChannelFactory factory = new HttpConversationServiceChannelFactory();
            IConversationService service = factory.CreateChannel();

            // Act
            IServiceResponse actual = service.DeleteConversation(new ServiceRequestWithData <Guid, ConversationService.ConversationParameters> {
                Data = new ConversationService.ConversationParameters()
            });

            // Assert
            Assert.AreEqual(ServiceResponseStateType.Succeeded, actual.State);
        }
Beispiel #3
0
        public void StartConversation_NoConversationName_FailedValidation()
        {
            // Arrange
            HttpConversationServiceChannelFactory factory = new HttpConversationServiceChannelFactory();
            IConversationService service = factory.CreateChannel();

            // Act
            IServiceResponse actual = service.StartConversation(new ServiceRequestWithData <Guid, ConversationService.StartConversationParameters> {
                Data = new ConversationService.StartConversationParameters {
                    Name = null
                }
            });

            // Assert
            Assert.AreEqual(ServiceResponseStateType.FailedValidation, actual.State);
        }
Beispiel #4
0
        public void StartConversation_TestConversationName_Succeeded()
        {
            // Arrange
            HttpConversationServiceChannelFactory factory = new HttpConversationServiceChannelFactory();
            IConversationService service = factory.CreateChannel();
            var random = new Random();

            // Act
            IServiceResponse actual = service.StartConversation(new ServiceRequestWithData <Guid, ConversationService.StartConversationParameters> {
                Data = new ConversationService.StartConversationParameters {
                    Name = string.Format("WCF Test Conversation {0:N0}", random.Next())
                }
            });

            // Assert
            Assert.AreEqual(ServiceResponseStateType.Succeeded, actual.State);
        }
Beispiel #5
0
        public void GetMessages_EachConversationsFromGet_MoreThanNoItems()
        {
            // Arrange
            HttpConversationServiceChannelFactory factory = new HttpConversationServiceChannelFactory();
            IConversationService service = factory.CreateChannel();
            IServiceResponseWithResultData <IEnumerable <ConversationSummaryEntity> > conversations = service.Get(new ServiceRequest <Guid>());

            foreach (ConversationSummaryEntity conversationSummary in conversations.ResultData)
            {
                // Act
                var actual = service.GetMessages(new ServiceRequestWithData <Guid, ConversationService.ConversationParameters> {
                    Data = new ConversationService.ConversationParameters {
                        ConversationRsn = conversationSummary.Rsn
                    }
                });

                // Assert
                Assert.IsTrue(actual.ResultData.Any());
            }
        }