Пример #1
0
        public void SessionBuilder_MapDataEntityToOpa_EntityIsNotGlobal()
        {
            // ARRANGE
            var sessionBuilder = new SessionBuilder();
            var session        = MapToOPATestSession();

            // ACT
            var instance = sessionBuilder.MapDataEntityToOpa(new DataEntity("Learner"), session, session.GetGlobalEntityInstance());

            // ASSERT
            instance.Should().NotBeNull();
            instance.GetEntity().IsGlobal().Should().BeFalse();
        }
Пример #2
0
        public void SessionBuilder_MapDataEntityToOpa_ChildEntityUpdated()
        {
            // ARRANGE
            var sessionBuilder = new SessionBuilder();
            var sessionPre     = MapToOPATestSession();
            var sessionPost    = MapToOPATestSession();

            // ACT
            sessionBuilder.MapDataEntityToOpa(TestGlobalEntity(), sessionPost, sessionPost.GetGlobalEntityInstance());
            var learnerPre  = EntityList(sessionPre);
            var learnerPost = EntityList(sessionPost);

            var learnerPrelist  = EntityInstanceList(sessionPre, learnerPre);
            var learnerPostlist = EntityInstanceList(sessionPost, learnerPost);

            // ASSERT
            sessionPost.Should().NotBe(sessionPre);
            learnerPrelist.Should().BeNullOrEmpty();
            learnerPostlist.Count.Should().Be(1);
        }