public void When_passing_an_xmlNode_Should_return_a_valid_Session()
        {
            var nodes = new StubProxyReader().GetSessions();
            var sessionMapper = new SessionMapper();
            var session = sessionMapper.Create(nodes[0]);

            Assert.That(session,Is.AssignableTo(typeof(Session)));
            Assert.That(session.Title.Length,Is.GreaterThan(0));
        }
        public void When_passing_an_xmlNode_Should_return_a_valid_Precompiler()
        {
            var nodes = new StubProxyReader().GetPrecompiler();
            var precompilerMapper = new PrecompilerMapper();
            var precompiler = precompilerMapper.Create(nodes[0]);

            Assert.That(precompiler, Is.AssignableTo(typeof(Precompiler)));
            Assert.That(precompiler.Title.Length, Is.GreaterThan(0));
        }
        public void When_passing_an_xmlNode_Should_return_a_valid_Speaker()
        {
            var nodes = new StubProxyReader().GetSpeakers();
            ISpeakerMapper speakerMapper = new SpeakerMapper();
            Speaker speaker = speakerMapper.Create(nodes[0]);

            Assert.That(speaker, Is.AssignableTo(typeof(Speaker)));
            Assert.That(speaker.Sessions.Count(),Is.GreaterThan(0));
        }
        public void When_calling_method_all_Should_return_an_IEnumerable_of_sessions()
        {
            var sessionMapper = new SessionMapper();
            var restProxyReader = new StubProxyReader();
            var sessionsFactory = new SessionRepository(sessionMapper, restProxyReader);

            var sessions = sessionsFactory.All();

            Assert.That(sessions.Count(),Is.GreaterThan(0));
            var singleSession = sessions.ToList()[0];
            Assert.That(singleSession, Is.Not.Null);
            Assert.That(singleSession, Is.AssignableTo(typeof(Session)));
        }
        public void When_Calling_selected_sessions_Should_return_an_IEnumerable_of_just_those_sessions()
        {
            var sessionMapper = new SessionMapper();
            var restProxyReader = new StubProxyReader();
            var sessionsFactory = new SessionRepository(sessionMapper, restProxyReader);

            var sessions = sessionsFactory.FindById("20,21,58");

            Assert.That(sessions.Count(), Is.GreaterThan(0));
            var sessionList = sessions.OrderBy(s => s.Id).ToList();
            Assert.That(sessionList[0].Id, Is.EqualTo(20));
            Assert.That(sessionList[1].Id, Is.EqualTo(21));
            Assert.That(sessionList[2].Id, Is.EqualTo(58));
        }
        public void When_passing_an_xml_node_Should_map_all_properties_an_elements_in_the_xml()
        {
            var nodes = new StubProxyReader().GetPrecompiler();
            var precompilerMapper = new PrecompilerMapper();
            var precompiler = precompilerMapper.Create(nodes[0]);

            Assert.That(precompiler.Title, Is.Not.Empty);
            Assert.That(precompiler.Abstract, Is.Not.Empty);
            Assert.That(precompiler.Start.HasValue, "Start time doesn't have a value");
            Assert.That(precompiler.Difficulty, Is.Not.Null);
            Assert.That(precompiler.Room, Is.Not.Null);
            Assert.That(precompiler.Technology, Is.Not.Null);
            Assert.That(precompiler.Track, Is.Not.Null);
            Assert.That(precompiler.SpeakerName, Is.Not.Null);
        }