Exemple #1
0
 public void SetStaticFieldThroughType()
 {
     Reflector.SetField(typeof(ReflectedDummy), "_staticField", nameof(SetStaticFieldThroughType));
     ReflectedDummy.StaticFieldSpy.Should().Be(nameof(SetStaticFieldThroughType));
 }
Exemple #2
0
 public void SetStaticFieldThroughGeneric()
 {
     Reflector.SetField <ReflectedDummy>("_staticField", nameof(SetStaticFieldThroughGeneric));
     ReflectedDummy.StaticFieldSpy.Should().Be(nameof(SetStaticFieldThroughGeneric));
 }
Exemple #3
0
 public void SetInstanceField()
 {
     Reflector.SetField(ReflectedDummy.Instance, "_field", nameof(SetInstanceField));
     ReflectedDummy.Instance.FieldSpy.Should().Be(nameof(SetInstanceField));
 }
Exemple #4
0
 public void SetStaticPropertyThroughType()
 {
     Reflector.SetProperty(typeof(ReflectedDummy), "StaticProperty", nameof(SetStaticPropertyThroughType));
     ReflectedDummy.StaticPropertySpy.Should().Be(nameof(SetStaticPropertyThroughType));
 }
Exemple #5
0
 public void SetStaticPropertyThroughGeneric()
 {
     Reflector.SetProperty <ReflectedDummy>("StaticProperty", nameof(SetStaticPropertyThroughGeneric));
     ReflectedDummy.StaticPropertySpy.Should().Be(nameof(SetStaticPropertyThroughGeneric));
 }
Exemple #6
0
 public void SetInstanceProperty()
 {
     Reflector.SetProperty(ReflectedDummy.Instance, "Property", nameof(SetInstanceProperty));
     ReflectedDummy.Instance.PropertySpy.Should().Be(nameof(SetInstanceProperty));
 }