protected virtual void CodeBasedSerializes() { var descriptor = new PutMappingDescriptor <T>().Properties(FluentProperties); if (this.AutoMap) { descriptor.AutoMap(); } Expect(ExpectJson) .WhenSerializing(descriptor as IPutMappingRequest); if (ExpectJsonFluentOnly != null) { Expect(ExpectJsonFluentOnly) .WhenSerializing(new PutMappingDescriptor <T>().Properties(FluentOnlyProperties) as IPutMappingRequest); } }