Esempio n. 1
0
        public void SetValue_of_long_ToNullableLongIdentityProperty_ValueIsAssigned()
        {
            var id   = StructureId.Create((long)42);
            var item = new NullableBigIdentityDummy();

            var property   = StructurePropertyTestFactory.GetIdProperty <NullableBigIdentityDummy>();
            var idAccessor = new IdAccessor(property);

            idAccessor.SetValue(item, id);

            Assert.AreEqual(id.Value, item.StructureId);
        }
Esempio n. 2
0
        public void SetValue_ToNullableGuidProperty_ValueIsAssigned()
        {
            var id   = StructureId.Create(Guid.Parse("fc47a673-5a5b-419b-9a40-a756591aa7bf"));
            var item = new NullableGuidDummy();

            var property   = StructurePropertyTestFactory.GetIdProperty <NullableGuidDummy>();
            var idAccessor = new IdAccessor(property);

            idAccessor.SetValue(item, id);

            Assert.AreEqual(id.Value, item.StructureId);
        }
Esempio n. 3
0
        public void SetValue_ToStringProperty_ValueIsAssigned()
        {
            var id   = StructureId.Create("Foo string id");
            var item = new StringDummy();

            var property   = StructurePropertyTestFactory.GetIdProperty <StringDummy>();
            var idAccessor = new IdAccessor(property);

            idAccessor.SetValue(item, id);

            Assert.AreEqual(id.Value, item.StructureId);
        }
        public void SetValue_ToGuidProperty_ValueIsAssigned()
        {
            var id = Guid.Parse("fc47a673-5a5b-419b-9a40-a756591aa7bf");
            var item = new GuidDummy();

            var property = TypeInfo<GuidDummy>.GetIdProperty("Id");
            var idAccessor = new IdAccessor(property);
            idAccessor.SetValue(item, id);

            Assert.AreEqual(id, item.Id);
        }
        public void SetValue_ToNullableIntProperty_ValueIsAssigned()
        {
            const int id = 42;
            var item = new IdentityDummy();

            var property = TypeInfo<IdentityDummy>.GetIdProperty("NullableId");
            var idAccessor = new IdAccessor(property);
            idAccessor.SetValue(item, id);

            Assert.AreEqual(id, item.NullableId);
        }
        public void SetValue_ToStringProperty_ValueIsAssigned()
        {
            var id = StructureId.Create("Foo string id");
            var item = new StringDummy();

            var property = StructurePropertyTestFactory.GetIdProperty<StringDummy>();
            var idAccessor = new IdAccessor(property);
            idAccessor.SetValue(item, id);

            Assert.AreEqual(id.Value, item.StructureId);
        }
        public void SetValue_of_long_ToNullableLongIdentityProperty_ValueIsAssigned()
        {
            var id = StructureId.Create((long)42);
            var item = new NullableBigIdentityDummy();

            var property = StructurePropertyTestFactory.GetIdProperty<NullableBigIdentityDummy>();
            var idAccessor = new IdAccessor(property);
            idAccessor.SetValue(item, id);

            Assert.AreEqual(id.Value, item.StructureId);
        }
        public void SetValue_ToNullableGuidProperty_ValueIsAssigned()
        {
            var id = StructureId.Create(Guid.Parse("fc47a673-5a5b-419b-9a40-a756591aa7bf"));
            var item = new NullableGuidDummy();

            var property = StructurePropertyTestFactory.GetIdProperty<NullableGuidDummy>();
            var idAccessor = new IdAccessor(property);
            idAccessor.SetValue(item, id);

            Assert.AreEqual(id.Value, item.StructureId);
        }