Esempio n. 1
0
 public void Init_Should_Apply_Entity_Channels_To_Aspect()
 {
     var expected = new[] {"one", "two", "three"};
     var e = new DefaultEntity("Test", expected).CreateLabelAspect("Label", 0, 0);
     var aspect = new LabelAspect();
     aspect.Init(e);
     Assert.True(aspect.Channels.All(s => expected.Contains(s)));
 }
Esempio n. 2
0
 public void Delete_Should_Set_IsDeleted()
 {
     var expected = true;
     var aspect = new LabelAspect();
     Assert.False(aspect.IsDeleted);
     aspect.Delete();
     Assert.Equal(expected, aspect.IsDeleted);
 }
Esempio n. 3
0
        public void Init_Should_Apply_Entity_Channels_To_Aspect()
        {
            var expected = new[] { "one", "two", "three" };
            var e        = new DefaultEntity("Test", expected).CreateLabelAspect("Label", 0, 0);
            var aspect   = new LabelAspect();

            aspect.Init(e);
            Assert.True(aspect.Channels.All(s => expected.Contains(s)));
        }
Esempio n. 4
0
        public void Delete_Should_Set_IsDeleted()
        {
            var expected = true;
            var aspect   = new LabelAspect();

            Assert.False(aspect.IsDeleted);
            aspect.Delete();
            Assert.Equal(expected, aspect.IsDeleted);
        }
Esempio n. 5
0
 public void Delete_Should_Notify_Deleted_Event()
 {
     var expected = true;
     var notified = false;
     var aspect = new LabelAspect();
     aspect.Deleted += (s, args) => notified = true;
     aspect.Delete();
     Assert.Equal(expected, notified);
 }
Esempio n. 6
0
        public void Delete_Should_Notify_Deleted_Event()
        {
            var expected = true;
            var notified = false;
            var aspect   = new LabelAspect();

            aspect.Deleted += (s, args) => notified = true;
            aspect.Delete();
            Assert.Equal(expected, notified);
        }
Esempio n. 7
0
 public void Init_Should_Create_Pointers_To_Entity_Components_From_Aspect()
 {
     var e = new DefaultEntity("Test", "default").CreateLabelAspect("Label", 0, 0);
     var aspect = new LabelAspect();
     aspect.Init(e);
     foreach (var component in e.Components.Values)
     {
         Assert.Equal(component, aspect.Components[component.GetType()]);
     }
 }
Esempio n. 8
0
        public void Init_Should_Create_Pointers_To_Entity_Components_From_Aspect()
        {
            var e      = new DefaultEntity("Test", "default").CreateLabelAspect("Label", 0, 0);
            var aspect = new LabelAspect();

            aspect.Init(e);
            foreach (var component in e.Components.Values)
            {
                Assert.Equal(component, aspect.Components[component.GetType()]);
            }
        }
Esempio n. 9
0
 public void Reset_Should_Clear_Components_and_Channels()
 {
     var e = new DefaultEntity("Test", "default").CreateLabelAspect("Label", 0, 0);
     var aspect = new LabelAspect();
     aspect.Init(e);
     Assert.True(aspect.Components.Count > 0);
     Assert.True(aspect.Channels.Count > 0);
     aspect.Reset();
     Assert.Equal(0, aspect.Components.Count);
     Assert.Equal(0, aspect.Channels.Count);
 }
Esempio n. 10
0
        public void Reset_Should_Clear_Components_and_Channels()
        {
            var e      = new DefaultEntity("Test", "default").CreateLabelAspect("Label", 0, 0);
            var aspect = new LabelAspect();

            aspect.Init(e);
            Assert.True(aspect.Components.Count > 0);
            Assert.True(aspect.Channels.Count > 0);
            aspect.Reset();
            Assert.Equal(0, aspect.Components.Count);
            Assert.Equal(0, aspect.Channels.Count);
        }