Exemplo n.º 1
0
        public void Unproxied_ReportsChanges_WhenChangesWereMade()
        {
            var interceptable = new InterceptableItem();

            interceptable.BoolProperty = true;

            bool wasChanged = factory.OnSaving(interceptable);

            Assert.That(wasChanged);
        }
Exemplo n.º 2
0
        public void Setting_LinkCollectionProperty_AssignesTo_DetailCollection_typed()
        {
            var values = new InterceptableItem[] { new InterceptableItem {
                                                       ID = 1
                                                   }, new InterceptableItem {
                                                       ID = 2
                                                   } };

            item.TypedCollectionProperty = values;
            Assert.That(item.GetDetailCollection("TypedCollectionProperty", false), Is.EquivalentTo(values));
        }
Exemplo n.º 3
0
        public void Getting_LinkCollectionProperty_ReadsFrom_DetailCollection_typed()
        {
            var values = new InterceptableItem[] { new InterceptableItem {
                                                       ID = 1
                                                   }, new InterceptableItem {
                                                       ID = 2
                                                   } };

            item.GetDetailCollection("TypedCollectionProperty", true).AddRange(values);
            item.TypedCollectionProperty.ShouldBe(values);
        }
Exemplo n.º 4
0
        public void Unproxied_DoesntReportChanges_WhenNoChangesWereMade()
        {
            var interceptable = new InterceptableItem();

            interceptable.SetDetail("BoolProperty", false, typeof(bool));
            interceptable.SetDetail("EnumProperty", TextBoxMode.SingleLine, typeof(TextBoxMode));
            interceptable.SetDetail("StringProperty", null, typeof(string));

            bool wasChanged = factory.OnSaving(interceptable);

            Assert.That(wasChanged, Is.False);
        }
Exemplo n.º 5
0
        public void Unproxied_StoresChanges_OnSaving()
        {
            var interceptable = new InterceptableItem();

            interceptable.BoolProperty   = true;
            interceptable.EnumProperty   = TextBoxMode.Password;
            interceptable.StringProperty = "hello";

            factory.OnSaving(interceptable);

            Assert.That(interceptable.GetDetail("BoolProperty"), Is.EqualTo(true));
            Assert.That(interceptable.GetDetail("EnumProperty"), Is.EqualTo(TextBoxMode.Password));
            Assert.That(interceptable.GetDetail("StringProperty"), Is.EqualTo("hello"));
        }
        public void Unproxied_StoresChanges_OnSaving()
        {
            var interceptable = new InterceptableItem();

            interceptable.BoolProperty = true;
            interceptable.EnumProperty = TextBoxMode.Password;
            interceptable.StringProperty = "hello";

            factory.OnSaving(interceptable);

            Assert.That(interceptable.GetDetail("BoolProperty"), Is.EqualTo(true));
            Assert.That(interceptable.GetDetail("EnumProperty"), Is.EqualTo(TextBoxMode.Password));
            Assert.That(interceptable.GetDetail("StringProperty"), Is.EqualTo("hello"));
        }
Exemplo n.º 7
0
 public void SetUp()
 {
     item = factory.Create(typeof(InterceptableItem).FullName, 0) as InterceptableItem;
 }
        public void Unproxied_ReportsChanges_WhenChangesWereMade()
        {
            var interceptable = new InterceptableItem();

            interceptable.BoolProperty = true;

            bool wasChanged = factory.OnSaving(interceptable);

            Assert.That(wasChanged);
        }
        public void Unproxied_DoesntReportChanges_WhenNoChangesWereMade()
        {
            var interceptable = new InterceptableItem();
            interceptable.SetDetail("BoolProperty", false, typeof(bool));
            interceptable.SetDetail("EnumProperty", TextBoxMode.SingleLine, typeof(TextBoxMode));
            interceptable.SetDetail("StringProperty", null, typeof(string));

            bool wasChanged = factory.OnSaving(interceptable);

            Assert.That(wasChanged, Is.False);
        }
 public void SetUp()
 {
     item = factory.Create(typeof(InterceptableItem).FullName, 0) as InterceptableItem;
 }
Exemplo n.º 11
0
		public void Getting_LinkCollectionProperty_ReadsFrom_DetailCollection_typed()
		{
			var values = new InterceptableItem[] { new InterceptableItem { ID = 1 }, new InterceptableItem { ID = 2 } };
			item.GetDetailCollection("TypedCollectionProperty", true).AddRange(values);
			item.TypedCollectionProperty.ShouldBe(values);
		}
Exemplo n.º 12
0
		public void Setting_LinkCollectionProperty_AssignesTo_DetailCollection_typed()
		{
			var values = new InterceptableItem[] { new InterceptableItem { ID = 1 }, new InterceptableItem { ID = 2 } };
			item.TypedCollectionProperty = values;
			Assert.That(item.GetDetailCollection("TypedCollectionProperty", false), Is.EquivalentTo(values));
		}