コード例 #1
0
        public async Task PublishActor_SendSqsMessage()
        {
            var actor = new Actor {
                FirstName = "Bruce", LastName = "Willis"
            };
            var response = await PublishClient.PublishActor(actor);

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
            SqsClientMock.Verify(x => x.PostMessageAsync(
                                     It.Is <Actor>(y => JsonConvert.SerializeObject(y) == JsonConvert.SerializeObject(actor))), Times.Once);
        }
コード例 #2
0
        public async Task PublishMovie_SendSqsMessage()
        {
            var movie = new Movie {
                Title = "Die hard", Genre = MovieGenre.Action
            };
            var response = await PublishClient.PublishMovie(movie);

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
            SqsClientMock.Verify(x => x.PostMessageAsync(
                                     It.Is <Movie>(y => JsonConvert.SerializeObject(y) == JsonConvert.SerializeObject(movie))), Times.Once);
        }
コード例 #3
0
 public void TestCleanup()
 {
     SqsClientMock.Verify(x => x.CreateQueueAsync(), Times.Once);
     SqsClientMock.VerifyNoOtherCalls();
 }