Exemplo n.º 1
0
        public void IsInHistory_NotInHistory_ReturnsFalse()
        {
            var sabRequest = new MockSabRequest { InputXml = XDocument.Load("SabHistory.xml") };
            ISabService sabService = new SabService(new Config(), sabRequest);
            var episode = new Episode
            {
                ShowName = "Stargate Universe",
                SeasonNumber = 2,
                EpisodeNumber = 1
            };

            bool actual = sabService.IsInHistory(episode);

            Expect(actual, Is.False);
        }
Exemplo n.º 2
0
        public void IsInHistory_ErrorResult_ReturnsFalse()
        {
            var input = new StringReader(
                @"<?xml version=""1.0"" encoding=""UTF-8"" ?>
                    <result><status>False</status>
                        <error>API Key Required</error>
                    </result>");
            var sabRequest = new MockSabRequest { InputXml = XDocument.Load(input) };
            ISabService sabService = new SabService(new Config(), sabRequest);
            var episode = new Episode
            {
                ShowName = "Stargate Universe",
                SeasonNumber = 1,
                EpisodeNumber = 19
            };

            bool actual = sabService.IsInHistory(episode);

            Expect(actual, Is.False);
        }
Exemplo n.º 3
0
 public MockSabService()
 {
     var sabRequest = new MockSabRequest { InputXml = XDocument.Load("SabHistory.xml") };
     Service = new SabService(new Config(), sabRequest);
 }