Пример #1
0
        public void ReadName_reads_user_defined_id_field()
        {
            IdReader.SetIdMember <TestModel8>("entityId");
            var name = IdReader.ReadName <TestModel8>();

            name.Should().Be("entityId");
        }
Пример #2
0
        public void ReadName_reads_user_defined_id_property()
        {
            IdReader.SetIdMember <TestModel7>("MyId");
            var name = IdReader.ReadName <TestModel7>();

            name.Should().Be("MyId");
        }
Пример #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);
        }
Пример #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);
        }
Пример #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));
        }
Пример #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));
        }
Пример #7
0
 public void SetIdMember_throws_on_invalid_arguments()
 {
     Assert.That(() => IdReader.SetIdMember <IdReaderTest>(" "), Throws.TypeOf <ArgumentNullException>());
 }