public void ReadName_reads_user_defined_id_field() { IdReader.SetIdMember <TestModel8>("entityId"); var name = IdReader.ReadName <TestModel8>(); name.Should().Be("entityId"); }
public void ReadName_reads_user_defined_id_property() { IdReader.SetIdMember <TestModel7>("MyId"); var name = IdReader.ReadName <TestModel7>(); name.Should().Be("MyId"); }
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); }
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); }
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)); }
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)); }
public void SetIdMember_throws_on_invalid_arguments() { Assert.That(() => IdReader.SetIdMember <IdReaderTest>(" "), Throws.TypeOf <ArgumentNullException>()); }