Ejemplo n.º 1
0
        public void Should_construct_speaker_with_first_and_last_name()
        {
            var speaker = new Speaker("Bob", "Smith");

            speaker.FirstName.ShouldEqual("Bob");
            speaker.LastName.ShouldEqual("Smith");
        }
Ejemplo n.º 2
0
        public Session(string title, string @abstract, Speaker speaker)
        {
            Title = title;
            Abstract = @abstract;
            Speaker = speaker;

            speaker.Register(this);
        }
Ejemplo n.º 3
0
        public void Should_map_session_fields()
        {
            var speaker = new Speaker("Joe", "Schmoe");
            var session = new Session("Foo", new string('a', 5000), speaker);

            SaveEntities(session);

            var loaded = SessionSource.CreateSession().Load<Session>(session.Id);

            loaded.Title.ShouldEqual(session.Title);
            loaded.Abstract.ShouldEqual(session.Abstract);
        }
Ejemplo n.º 4
0
        public void Should_cascade_to_speaker()
        {
            var speaker = new Speaker("Joe", "Schmoe");
            var session = new Session("Foo", "Bar", speaker);

            SaveEntities(session);

            var loaded = SessionSource.CreateSession().Load<Session>(session.Id);

            loaded.Speaker.ShouldEqual(speaker);

            loaded.Speaker.GetSessions().Count().ShouldEqual(1);
        }
Ejemplo n.º 5
0
        public void Should_construct_session_with_title_abstract_and_speaker()
        {
            var title = "Some Title";
            var @abstract = "A bunch of stuff";
            var speaker = new Speaker("Joe", "Schmoe");

            var session = new Session(title, @abstract, speaker);

            session.Title.ShouldEqual(title);
            session.Abstract.ShouldEqual(@abstract);
            session.Speaker.ShouldEqual(speaker);
            speaker.GetSessions().Any(s => s == session).ShouldBeTrue();
        }
Ejemplo n.º 6
0
        public void Should_map_all_speaker_fields()
        {
            var speaker = new Speaker("Joe", "Schmoe")
            {
                Bio = "I come from France"
            };

            SaveEntities(speaker);

            var loaded = SessionSource.CreateSession().Load<Speaker>(speaker.Id);

            loaded.FirstName.ShouldEqual(speaker.FirstName);
            loaded.LastName.ShouldEqual(speaker.LastName);
            loaded.Bio.ShouldEqual(speaker.Bio);
        }