public void TestThatSetStubOverridesExistingStub() { StubContainer <IFoo> container = new StubContainer <IFoo>(); BasicDelegate del = () => { }; BasicDelegate del2 = () => { throw new Exception(); }; container.SetMethodStub(del, Times.Forever, true); container.SetMethodStub(del2, Times.Forever, true); Assert.AreEqual(del2, container.GetMethodStub <BasicDelegate>("Foo")); }
public void TestThatGenericDelegatesWithDifferentGenericTypeDontConflict() { StubContainer <IFoo> container = new StubContainer <IFoo>(); GenericDelegate <int> del = () => 1; GenericDelegate <string> del2 = () => "text"; container.SetMethodStub(del, Times.Forever, true); container.SetMethodStub(del2, Times.Forever, true); Assert.AreEqual(del, container.GetMethodStub <GenericDelegate <int> >("Foo1")); Assert.AreEqual(del2, container.GetMethodStub <GenericDelegate <string> >("Foo2")); }
public void TestThatDelegatesWithTheSameSignatureDontConflict() { StubContainer <IFoo> container = new StubContainer <IFoo>(); BasicDelegate del = () => { }; BasicDelegate2 del2 = () => { throw new Exception(); }; container.SetMethodStub(del, Times.Forever, true); container.SetMethodStub(del2, Times.Forever, true); Assert.AreEqual(del, container.GetMethodStub <BasicDelegate>("Foo1")); Assert.AreEqual(del2, container.GetMethodStub <BasicDelegate2>("Foo2")); }
public void TestSetGetMethodStub() { StubContainer <IFoo> container = new StubContainer <IFoo>(); BasicDelegate del = () => { }; container.SetMethodStub(del, 1, true); Assert.AreEqual(del, container.GetMethodStub <BasicDelegate>("Foo")); }
public StubIPIDController Setpoint_Get(Setpoint_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIInfraredSensor Initialize(Initialize_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIEntityConfig SetupEntity(SetupEntity_ModelBuilder_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIGenericInterface <T> GetAThing(GetAThing_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIReader GetSingleById(GetSingleById_Int32_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIEntityViewModel Writer_Get(Writer_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIWebRequestCreate Create(Create_Uri_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIHipsterService GetSentenceAsync(GetSentenceAsync_Int32_HipsterTypeHipsterTypeLatin_Boolean_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIService GetData(GetData_Int32_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIClipboard SetContent(SetContent_DataPackage_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubISearchViewModel SelectedSite_Get(SelectedSite_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubINetworkApi Sites(Sites_Int32_Int32_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIAuthenticationViewModel Login_Get(Login_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIMotorControl Initialize(Initialize_Int32_Int32_Int32_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIAlphaBotControlServer Start(Start_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubILoginRecognizer GetLoginType(GetLoginType_Uri_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIMeasurementsExporter Formats_Get(Formats_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubICompany Id_Get(Id_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIMeasurementManager AvailableMeasurementMethods_Get(AvailableMeasurementMethods_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIWriter WriteDummyData(WriteDummyData_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIElement RequiredMeasurementCount_Get(RequiredMeasurementCount_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIEntityViewModelFactory GetEntityViewModel(GetEntityViewModel_String_IEntity_Int32_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIAsyncInitialization Initialization_Get(Initialization_Get_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubIGenericRepository <T> GetAll(GetAll_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }
public StubISomeInterface DoAThing(DoAThing_Delegate del, int count = Times.Forever, bool overwrite = false) { _stubs.SetMethodStub(del, count, overwrite); return(this); }