Пример #1
0
        public void Test_SearchIdLookupRequest_Validate_Throws_ArgumentException()
        {
            // id type is unspecified
            var request = new SearchIdLookupRequest {
                LookupId = "lookupId", IdType = TraktSearchIdType.Unspecified
            };

            Action act = () => request.Validate();

            act.Should().Throw <ArgumentException>();

            // lookup id is empty
            request = new SearchIdLookupRequest {
                LookupId = string.Empty, IdType = TraktSearchIdType.Trakt
            };

            act = () => request.Validate();
            act.Should().Throw <ArgumentException>();

            // lookup id contains spaces
            request = new SearchIdLookupRequest {
                LookupId = "lookup id", IdType = TraktSearchIdType.Trakt
            };

            act = () => request.Validate();
            act.Should().Throw <ArgumentException>();
        }
Пример #2
0
        public void Test_SearchIdLookupRequest_Validate_Throws_ArgumentNullException()
        {
            // no id type set
            var request = new SearchIdLookupRequest {
                LookupId = "lookupId"
            };

            Action act = () => request.Validate();

            act.Should().Throw <ArgumentNullException>();

            // no lookup id set
            request = new SearchIdLookupRequest {
                IdType = TraktSearchIdType.Trakt
            };

            act = () => request.Validate();
            act.Should().Throw <ArgumentNullException>();
        }