Ejemplo n.º 1
0
        public void ShouldExtractPrivateField(int fieldValue)
        {
            // Arrange
            var sut = new TestClassWithPrivateField(fieldValue);

            // Act
            var actual = (int)MethodHelper.GetPropertyOrFieldValue(sut, "field");

            // Assert
            Assert.Equal(fieldValue, actual);
        }
Ejemplo n.º 2
0
 public void ShouldThrowArgumentExceptionOnIncorrectProperty(TestClassWithPrivateField sut, string propertyName)
 {
     // Act & Assert
     Assert.Throws <ArgumentException>(() => MethodHelper.GetPropertyOrFieldValue(sut, propertyName));
 }