コード例 #1
0
        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"));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        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"));
        }
コード例 #4
0
        public void TestSetGetMethodStub()
        {
            StubContainer <IFoo> container = new StubContainer <IFoo>();
            BasicDelegate        del       = () => { };

            container.SetMethodStub(del, 1, true);

            Assert.AreEqual(del, container.GetMethodStub <BasicDelegate>("Foo"));
        }
コード例 #5
0
 public StubIPIDController Setpoint_Get(Setpoint_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #6
0
 public StubIInfraredSensor Initialize(Initialize_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #7
0
 public StubIEntityConfig SetupEntity(SetupEntity_ModelBuilder_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #8
0
 public StubIGenericInterface <T> GetAThing(GetAThing_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #9
0
 public StubIReader GetSingleById(GetSingleById_Int32_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #10
0
 public StubIEntityViewModel Writer_Get(Writer_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #11
0
 public StubIWebRequestCreate Create(Create_Uri_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #12
0
 public StubIHipsterService GetSentenceAsync(GetSentenceAsync_Int32_HipsterTypeHipsterTypeLatin_Boolean_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #13
0
 public StubIService GetData(GetData_Int32_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #14
0
 public StubIClipboard SetContent(SetContent_DataPackage_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #15
0
 public StubISearchViewModel SelectedSite_Get(SelectedSite_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #16
0
 public StubINetworkApi Sites(Sites_Int32_Int32_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #17
0
 public StubIAuthenticationViewModel Login_Get(Login_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #18
0
 public StubIMotorControl Initialize(Initialize_Int32_Int32_Int32_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #19
0
 public StubIAlphaBotControlServer Start(Start_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #20
0
 public StubILoginRecognizer GetLoginType(GetLoginType_Uri_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #21
0
 public StubIMeasurementsExporter Formats_Get(Formats_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #22
0
 public StubICompany Id_Get(Id_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #23
0
 public StubIMeasurementManager AvailableMeasurementMethods_Get(AvailableMeasurementMethods_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #24
0
 public StubIWriter WriteDummyData(WriteDummyData_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #25
0
 public StubIElement RequiredMeasurementCount_Get(RequiredMeasurementCount_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #26
0
 public StubIEntityViewModelFactory GetEntityViewModel(GetEntityViewModel_String_IEntity_Int32_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #27
0
 public StubIAsyncInitialization Initialization_Get(Initialization_Get_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #28
0
 public StubIGenericRepository <T> GetAll(GetAll_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }
コード例 #29
0
 public StubISomeInterface DoAThing(DoAThing_Delegate del, int count = Times.Forever, bool overwrite = false)
 {
     _stubs.SetMethodStub(del, count, overwrite);
     return(this);
 }