public void BuildString_Scenarios_StringMatches(int? season, int? episode, int? limit, int? year, string expected)
        {
            var limitsBuilder = new LimitsBuilder();
            var limits = new S4ULimits { Season = season, Episode = episode, Limit = limit, Year = year};

            var result = limitsBuilder.BuildString(limits);

            Assert.That(result, Is.EqualTo(expected));
        }
        public void BuildString_NoLimits_EmptyString(
            int season,
            LimitsBuilder sut)
        {
            var limits = new S4ULimits();

            var result = sut.BuildString(limits);

            Assert.That(result, Is.Empty);
        }
        public void BuildString_CustomLimits_CustomsAreIncludedInString(
            KeyValuePair<string, string> custom,
            S4ULimits limits,
            LimitsBuilder sut)
        {
            var expected = custom.Key + "=" + custom.Value;
            limits.Custom.Add(custom);

            var result = sut.BuildString(limits);

            Assert.That(result.Contains(expected));
        }
Пример #4
0
 public S4UApi(S4USettings settings)
 {
     _baseUrl =  $"{SiteUrl}/{settings.ApiKey}/xml/serie/";
     _limitsBuilder = new LimitsBuilder();
     _xmlSerializer = new XmlSerializer(typeof(Response));
 }