public void ApplyParametersHandlesNull() { var task = new TestTask { DynamicValues = null }; var parameters = new Dictionary<string, string>(); var definitions = new List<ParameterBase>(); task.ApplyParameters(parameters, definitions); }
public void ApplyParametersHandlesEmpty() { var task = new TestTask { DynamicValues = new IDynamicValue[0] }; var parameters = new Dictionary <string, string>(); var definitions = new List <ParameterBase>(); task.ApplyParameters(parameters, definitions); }
public void ApplyParametersHandlesParameter() { var dynamicValue = mocks.Create <IDynamicValue>(MockBehavior.Strict).Object; var task = new TestTask { DynamicValues = new IDynamicValue[] { dynamicValue } }; var parameters = new Dictionary <string, string>(); var definitions = new List <ParameterBase>(); Mock.Get(dynamicValue).Setup(_dynamicValue => _dynamicValue.ApplyTo(task, parameters, definitions)).Verifiable(); task.ApplyParameters(parameters, definitions); mocks.VerifyAll(); }
public void ApplyParametersHandlesParameter() { var dynamicValue = mocks.StrictMock<IDynamicValue>(); var task = new TestTask { DynamicValues = new IDynamicValue[] { dynamicValue } }; var parameters = new Dictionary<string, string>(); var definitions = new List<ParameterBase>(); Expect.Call(() => { dynamicValue.ApplyTo(task, parameters, definitions); }); mocks.ReplayAll(); task.ApplyParameters(parameters, definitions); mocks.VerifyAll(); }
public void ApplyParametersHandlesParameter() { var dynamicValue = mocks.StrictMock <IDynamicValue>(); var task = new TestTask { DynamicValues = new IDynamicValue[] { dynamicValue } }; var parameters = new Dictionary <string, string>(); var definitions = new List <ParameterBase>(); Expect.Call(() => { dynamicValue.ApplyTo(task, parameters, definitions); }); mocks.ReplayAll(); task.ApplyParameters(parameters, definitions); mocks.VerifyAll(); }
public void ApplyParametersStoresTheArguments() { var parameters = new Dictionary <string, string>(); var definitions = new List <ParameterBase>(); var subTask = new MockTask(); var task = new TestTask { Tasks = new ITask[] { subTask } }; var result = mocks.Create <IIntegrationResult>().Object; task.ApplyParameters(parameters, definitions); task.Run(result); mocks.VerifyAll(); Assert.AreSame(parameters, subTask.Parameters); Assert.AreSame(definitions, subTask.Definitions); Assert.IsTrue(subTask.Executed); }
public void ApplyParametersStoresTheArguments() { var parameters = new Dictionary<string, string>(); var definitions = new List<ParameterBase>(); var subTask = new MockTask(); var task = new TestTask { Tasks = new ITask[] { subTask } }; var result = mocks.DynamicMock<IIntegrationResult>(); mocks.ReplayAll(); task.ApplyParameters(parameters, definitions); task.Run(result); mocks.VerifyAll(); Assert.AreSame(parameters, subTask.Parameters); Assert.AreSame(definitions, subTask.Definitions); Assert.IsTrue(subTask.Executed); }