public void ReflectionDetails_BadName_ThrowException() { string operationName = "Method"; MyTestClass myTestClass = new MyTestClass(); var ex = Assert.Throws <ArgumentNullException>(() => ReflectionDetails.GenerateOperation(myTestClass, operationName)); StringAssert.Contains("Bad operation name!", ex.Message); }
public void ReflectionDetails_GoodName_CreateOperation() { string operationName = "ExtraMethod"; MyTestClass myTestClass = new MyTestClass(); var operation = ReflectionDetails.GenerateOperation(myTestClass, operationName); var result = operation.Name; StringAssert.Contains(operationName, operation.Name); Assert.NotNull(operation); Assert.True(operation.Parameters[0].IsValueTypeOrString); Assert.False(operation.Parameters[1].IsValueTypeOrString); }