C# 클래스 Google.ProtocolBuffers.ReflectionTester

Performs the same things that the methods of TestUtil do, but via the reflection interface. This is its own class because it needs to know what descriptor to use.
파일 보기 프로젝트 열기: ayende/dotnet-protobufs 1 사용 예제들

공개 메소드들

메소드 설명
AssertAllFieldsSetViaReflection ( IMessage message ) : void

Asserts that all fields of the specified message are set to the values assigned by SetAllFields, using the IMessage reflection interface.

AssertClearViaReflection ( IMessage message ) : void

Assert that all fields of the message are cleared, and that getting the fields returns their default values, using the reflection interface.

AssertPackedFieldsSetViaReflection ( IMessage message ) : void
AssertReflectionRepeatedSettersRejectNull ( IBuilder builder ) : void

Verifies that the reflection repeated setters for the given Builder object throw an ArgumentNullException if they are passed a null value.

AssertReflectionSettersRejectNull ( IBuilder builder ) : void

Verifies that the reflection setters for the given Builder object throw an ArgumentNullException if they are passed a null value.

CreateTestAllExtensionsInstance ( ) : ReflectionTester

Creates an instance for the TestAllExtensions message, with an extension registry from TestUtil.CreateExtensionRegistry.

CreateTestAllTypesInstance ( ) : ReflectionTester

Creates an instance for the TestAllTypes message, with no extension registry.

CreateTestPackedTypesInstance ( ) : ReflectionTester

Creates an instance for the TestPackedTypes message, with no extensions.

SetPackedFieldsViaReflection ( IBuilder message ) : void

비공개 메소드들

메소드 설명
AssertRepeatedFieldsModifiedViaReflection ( IMessage message ) : void
CreateBuilderForField ( IBuilder parent, FieldDescriptor field ) : IBuilder

Calls parent.CreateBuilderForField() or uses the extension registry to find an appropriate builder, depending on what type is being tested.

ModifyRepeatedFieldsViaReflection ( IBuilder message ) : void

Modify the repeated fields of the specified message to contain the values expected by AssertRepeatedFieldsModified, using the IBuilder reflection interface.

ReflectionTester ( MessageDescriptor baseDescriptor, ExtensionRegistry extensionRegistry ) : System

Constructs an instance that will expect messages using the given descriptor. Normally baseDescriptor should be a descriptor for TestAllTypes. However, if extensionRegistry is non-null, then baseDescriptor should be for TestAllExtensions instead, and instead of reading and writing normal fields, the tester will read and write extensions. All of the TestAllExtensions extensions must be registered in the registry.

SetAllFieldsViaReflection ( IBuilder message ) : void

Sets every field of the message to the values expected by AssertAllFieldsSet, using the reflection interface.

f ( String name ) : FieldDescriptor

Shorthand to get a FieldDescriptor for a field of unittest::TestAllTypes.

메소드 상세

AssertAllFieldsSetViaReflection() 공개 메소드

Asserts that all fields of the specified message are set to the values assigned by SetAllFields, using the IMessage reflection interface.
public AssertAllFieldsSetViaReflection ( IMessage message ) : void
message IMessage
리턴 void

AssertClearViaReflection() 공개 메소드

Assert that all fields of the message are cleared, and that getting the fields returns their default values, using the reflection interface.
public AssertClearViaReflection ( IMessage message ) : void
message IMessage
리턴 void

AssertPackedFieldsSetViaReflection() 공개 메소드

public AssertPackedFieldsSetViaReflection ( IMessage message ) : void
message IMessage
리턴 void

AssertReflectionRepeatedSettersRejectNull() 공개 메소드

Verifies that the reflection repeated setters for the given Builder object throw an ArgumentNullException if they are passed a null value.
public AssertReflectionRepeatedSettersRejectNull ( IBuilder builder ) : void
builder IBuilder
리턴 void

AssertReflectionSettersRejectNull() 공개 메소드

Verifies that the reflection setters for the given Builder object throw an ArgumentNullException if they are passed a null value.
public AssertReflectionSettersRejectNull ( IBuilder builder ) : void
builder IBuilder
리턴 void

CreateTestAllExtensionsInstance() 공개 정적인 메소드

Creates an instance for the TestAllExtensions message, with an extension registry from TestUtil.CreateExtensionRegistry.

CreateTestAllTypesInstance() 공개 정적인 메소드

Creates an instance for the TestAllTypes message, with no extension registry.

CreateTestPackedTypesInstance() 공개 정적인 메소드

Creates an instance for the TestPackedTypes message, with no extensions.

SetPackedFieldsViaReflection() 공개 메소드

public SetPackedFieldsViaReflection ( IBuilder message ) : void
message IBuilder
리턴 void