Example #1
0
        public void GetBucketListItem_HappyPathTest()
        {
            var tgimbaApi = new SharedTgimbaApiController(this.tgimbaService.Object, this.validationHelper.Object);

            var request = GetBucketListItemRequest();

            IActionResult result = tgimbaApi.GetBucketListItem(request);

            GoodResultVerify(result);
            tgimbaService.Verify(x => x.GetBucketListItems(It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>())
                                 , Times.Once);
        }
Example #2
0
        public void GetBucketListItem_GeneralErrorTest()
        {
            var tgimbaApi = new SharedTgimbaApiController(this.tgimbaService.Object, this.validationHelper.Object);

            var request = GetBucketListItemRequest();

            tgimbaService.Setup(x => x.GetBucketListItems(It.IsAny <string>(),
                                                          It.IsAny <string>(),
                                                          It.IsAny <string>(),
                                                          It.IsAny <string>(),
                                                          It.IsAny <string>(),
                                                          It.IsAny <string>()))
            .Throws(new Exception("I am an exception"));

            IActionResult result = tgimbaApi.GetBucketListItem(request);

            BadResultVerify(result, 500);
        }
Example #3
0
        public void GetBucketListItem_ValidationErrorTest()
        {
            var tgimbaApi = new SharedTgimbaApiController(this.tgimbaService.Object, this.validationHelper.Object);

            var request = GetBucketListItemRequest();

            validationHelper.Setup(x => x.IsValidRequest
                                       (It.IsAny <GetBucketListItemRequest>()))
            .Throws(new ArgumentNullException(""));

            IActionResult result = tgimbaApi.GetBucketListItem(request);

            BadResultVerify(result);

            tgimbaService.Verify(x => x.GetBucketListItems(It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>(),
                                                           It.IsAny <string>())
                                 , Times.Never);
        }