public void DoubleParameterDoWithNullActionThrows() { var builder = new DelegatingSpecimenBuilder(); Assert.Throws <ArgumentNullException>(() => builder.Do <double, decimal>(null)); }
public void SingleParameterDoWillInvokeMethodWithCorrectParameter( int expected) { // Fixture setup var builder = new DelegatingSpecimenBuilder(); builder.OnCreate = (r, c) => expected; var verified = false; var mock = new CommandMock<int>(); mock.OnCommand = x => verified = expected == x; // Exercise system builder.Do((int i) => mock.Command(i)); // Verify outcome Assert.True(verified, "Mock wasn't verified."); // Teardown }
public void SingleParameterDoWillInvokeMethodWithCorrectParameter( int expected) { // Arrange var builder = new DelegatingSpecimenBuilder(); builder.OnCreate = (r, c) => expected; var verified = false; var mock = new CommandMock <int>(); mock.OnCommand = x => verified = expected == x; // Act builder.Do((int i) => mock.Command(i)); // Assert Assert.True(verified, "Mock wasn't verified."); }
public void SingleParameterDoWillInvokeMethodWithCorrectParameter( int expected) { // Fixture setup var builder = new DelegatingSpecimenBuilder(); builder.OnCreate = (r, c) => expected; var verified = false; var mock = new CommandMock <int>(); mock.OnCommand = x => verified = expected == x; // Exercise system builder.Do((int i) => mock.Command(i)); // Verify outcome Assert.True(verified, "Mock wasn't verified."); // Teardown }
public void DoubleParameterDoWithNullActionThrows() { var builder = new DelegatingSpecimenBuilder(); Assert.Throws<ArgumentNullException>(() => builder.Do<double, decimal>(null)); }