public void ReadType_reads_Id_field()
        {
            var type = IdReader.ReadType <TestModel2>();

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

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

            type2.Should().Be(typeof(int));
        }
        public void ReadType_reads_Id_property()
        {
            var type = IdReader.ReadType <TestModel>();

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

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

            type2.Should().Be(typeof(Guid));
        }
        public void ReadType_reads_underscore_id_field()
        {
            var type = IdReader.ReadType <TestModel6>();

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

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

            type2.Should().Be(typeof(double));
        }
        public void ReadType_reads_underscore_id_property()
        {
            var type = IdReader.ReadType <TestModel5>();

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

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

            type2.Should().Be(typeof(float));
        }
        public void ReadType_reads_lowercase_id_field()
        {
            var type = IdReader.ReadType <TestModel4>();

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

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

            type2.Should().Be(typeof(long));
        }
        public void ReadType_reads_lowercase_id_property()
        {
            var type = IdReader.ReadType <TestModel3>();

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

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

            type2.Should().Be(typeof(string));
        }
        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 ReadType_throws_on_invalid_arguments()
 {
     Assert.That(() => IdReader.ReadType(null), Throws.TypeOf <ArgumentNullException>());
 }
 public void ReadType_throws_when_no_id_field_present()
 {
     Assert.That(() => IdReader.ReadType <TestMetadata>(), Throws.ArgumentException);
 }