public void ReflectionParameterTest() { var intPropertyClassInstance = EnvironmentManager.CreateInstanceWithProperty(4); var intPrivatePropertyClassInstance = EnvironmentManager.CreateInstanceWithPrivateProperty(8); var intFieldClassInstance = EnvironmentManager.CreateInstanceWithField(6); var intPrivateFieldClassInstance = EnvironmentManager.CreateInstanceWithPrivateField(7); var stringPropertyClassInstance = EnvironmentManager.CreateInstanceWithProperty("qwerty1"); var stringPrivatePropertyClassInstance = EnvironmentManager.CreateInstanceWithPrivateProperty("qwerty2"); var stringFieldClassInstance = EnvironmentManager.CreateInstanceWithField("qwerty3"); var stringPrivateFieldClassInstance = EnvironmentManager.CreateInstanceWithPrivateField("qwerty4"); var intParameter = new ReflectionParameter <int>(); var stringParameter = new ReflectionParameter <string>(); intParameter.Target = intPropertyClassInstance; intParameter.SourceName = nameof(intPropertyClassInstance.Property); intParameter.GetParamType().Should().BeAssignableTo <int>(); intParameter.GetValue().Should().Be(4); intParameter.Target = intPrivatePropertyClassInstance; intParameter.SourceName = nameof(intPropertyClassInstance.Property); intParameter.GetParamType().Should().BeAssignableTo <int>(); intParameter.GetValue().Should().Be(null); intParameter.Target = intFieldClassInstance; intParameter.SourceName = nameof(intFieldClassInstance.Field); intParameter.GetParamType().Should().BeAssignableTo <int>(); intParameter.GetValue().Should().Be(6); intParameter.Target = intPrivateFieldClassInstance; intParameter.SourceName = nameof(intFieldClassInstance.Field); intParameter.GetParamType().Should().BeAssignableTo <int>(); intParameter.GetValue().Should().Be(7); stringParameter.Target = stringPropertyClassInstance; stringParameter.SourceName = nameof(stringPropertyClassInstance.Property); stringParameter.GetParamType().Should().BeAssignableTo <string>(); stringParameter.GetValue().Should().Be("qwerty1"); stringParameter.Target = stringPrivatePropertyClassInstance; stringParameter.SourceName = nameof(stringPropertyClassInstance.Property); stringParameter.GetParamType().Should().BeAssignableTo <string>(); stringParameter.GetValue().Should().Be(null); stringParameter.Target = stringFieldClassInstance; stringParameter.SourceName = nameof(stringFieldClassInstance.Field); stringParameter.GetParamType().Should().BeAssignableTo <string>(); stringParameter.GetValue().Should().Be("qwerty3"); stringParameter.Target = stringPrivateFieldClassInstance; stringParameter.SourceName = nameof(stringFieldClassInstance.Field); stringParameter.GetParamType().Should().BeAssignableTo <string>(); stringParameter.GetValue().Should().Be("qwerty4"); }