예제 #1
0
        public static void Speaker_request__is_valid_request__false()
        {
            // Arrange
            Mock <ICommonDependencyProvider> provider = new Mock <ICommonDependencyProvider>(MockBehavior.Strict);
            Mock <IAmazonSQS> sqsClient = new Mock <IAmazonSQS>(MockBehavior.Strict);
            var speakerRequest          = new SpeakerRequest(provider.Object, sqsClient.Object, "foo-bar-queue")
            {
                SpeakerAction = "foo-bar"
            };

            // Act
            var response = speakerRequest.IsValidRequest();

            // Assert
            Assert.False(response);
        }
예제 #2
0
        public static void Speaker_request__is_valid_request__true()
        {
            // Arrange
            Mock <ICommonDependencyProvider> provider = new Mock <ICommonDependencyProvider>(MockBehavior.Strict);
            Mock <IAmazonSQS> sqsClient = new Mock <IAmazonSQS>(MockBehavior.Strict);
            var speakerRequestOn        = new SpeakerRequest(provider.Object, sqsClient.Object, "foo-bar-queue")
            {
                SpeakerAction = "on"
            };
            var speakerRequestOff = new SpeakerRequest(provider.Object, sqsClient.Object, "foo-bar-queue")
            {
                SpeakerAction = "off"
            };

            // Act
            var responseOn  = speakerRequestOn.IsValidRequest();
            var responseOff = speakerRequestOff.IsValidRequest();

            // Assert
            Assert.True(responseOn);
            Assert.True(responseOff);
        }