Ejemplo n.º 1
0
        public void IsValidRequest_DeleteBucketListItemRequest_Tests
        (
            int id,
            bool nullRequest,
            bool validationErrorExpected
        )
        {
            DeleteBucketListItemRequest request = null;
            var token = SetTokenRequest();

            if (!nullRequest)
            {
                request = new DeleteBucketListItemRequest()
                {
                    BucketListItemId = id,
                    EncodedToken     = token.EncodedToken,
                    EncodedUserName  = token.EncodedUserName
                };
            }

            try
            {
                sut.IsValidRequest(request.EncodedUserName, request.EncodedToken, request.BucketListItemId);
                Assert.IsFalse(validationErrorExpected);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(validationErrorExpected);
                Assert.IsTrue(ex is ArgumentNullException);
            }
        }