Esempio n. 1
0
        public void ReadName_reads_user_defined_id_field()
        {
            IdReader.SetIdMember <TestModel8>("entityId");
            var name = IdReader.ReadName <TestModel8>();

            name.Should().Be("entityId");
        }
Esempio n. 2
0
        public void ReadName_reads_user_defined_id_property()
        {
            IdReader.SetIdMember <TestModel7>("MyId");
            var name = IdReader.ReadName <TestModel7>();

            name.Should().Be("MyId");
        }
Esempio n. 3
0
        public void ReadValue_reads_user_defined_id_field()
        {
            var _id       = 3ul;
            var testModel = new TestModel8(_id);

            IdReader.SetIdMember <TestModel8>("entityId");
            var id = IdReader.ReadValue(testModel);

            id.Should().Be(_id);
        }
Esempio n. 4
0
        public void ReadValue_reads_user_defined_id_property()
        {
            var _id       = 3u;
            var testModel = new TestModel7(_id);

            IdReader.SetIdMember <TestModel7>("MyId");
            var id = IdReader.ReadValue(testModel);

            id.Should().Be(_id);
        }
Esempio n. 5
0
        public void ReadType_reads_user_defined_id_field()
        {
            IdReader.SetIdMember <TestModel8>("entityId");
            var type = IdReader.ReadType <TestModel8>();

            type.Should().Be(typeof(ulong));

            var type2 = IdReader.ReadType(typeof(TestModel8));

            type2.Should().Be(typeof(ulong));
        }
Esempio n. 6
0
        public void ReadType_reads_user_defined_id_property()
        {
            IdReader.SetIdMember <TestModel7>("MyId");
            var type = IdReader.ReadType <TestModel7>();

            type.Should().Be(typeof(uint));

            var type2 = IdReader.ReadType(typeof(TestModel7));

            type2.Should().Be(typeof(uint));
        }
Esempio n. 7
0
 public void SetIdMember_throws_on_invalid_arguments()
 {
     Assert.That(() => IdReader.SetIdMember <IdReaderTest>(" "), Throws.TypeOf <ArgumentNullException>());
 }