Inheritance: ITestStateManager
コード例 #1
0
        public void SetUp()
        {
            test = new Test("my test");
            service = new TestConverter();

            listener1 = MockRepository.GenerateMock<ITestStateListener>();
            listener2 = MockRepository.GenerateMock<ITestStateListener>();
            listener3 = MockRepository.GenerateMock<ITestStateListener>();

            manager = new TestStateManager(service, test);

            manager.RegisterListener(listener1);
            manager.RegisterListener(listener2);
            manager.RegisterListener(listener3);
        }
コード例 #2
0
        public void SetUp()
        {
            test = new Test("my test");
            service = MockRepository.GenerateMock<ITestConverter>();

            listener1 = MockRepository.GenerateMock<ITestStateListener>();
            source = MockRepository.GenerateMock<ITestStateListener>();
            listener3 = MockRepository.GenerateMock<ITestStateListener>();

            manager = new TestStateManager(service, test);

            manager.RegisterListener(listener1);
            manager.RegisterListener(source);
            manager.RegisterListener(listener3);

            theNewJson = "{new: 'json'}";

            service.Expect(x => x.ToJson(test)).Return(theNewJson);

            manager.Version(source);
            manager.RecordSnapshot();
        }
コード例 #3
0
        public void SetUp()
        {
            test = new Test("my test");
            service = MockRepository.GenerateMock<ITestConverter>();

            listener1 = MockRepository.GenerateMock<ITestStateListener>();
            source = MockRepository.GenerateMock<ITestStateListener>();
            listener3 = MockRepository.GenerateMock<ITestStateListener>();

            manager = new TestStateManager(service, test);

            manager.RegisterListener(listener1);
            manager.RegisterListener(source);
            manager.RegisterListener(listener3);

            theNewJson = "{new: 'json'}";

            manager.StoreJson(theNewJson, source);
        }
コード例 #4
0
        public void SetUp()
        {
            test = new Test("my test");
            service = MockRepository.GenerateMock<ITestConverter>();

            listener1 = MockRepository.GenerateMock<ITestStateListener>();
            listener2 = MockRepository.GenerateMock<ITestStateListener>();
            listener3 = MockRepository.GenerateMock<ITestStateListener>();

            manager = new TestStateManager(service, test);

            manager.RegisterListener(listener1);
            manager.RegisterListener(listener2);
            manager.RegisterListener(listener3);

            theOriginalJson = "{old: 'json'}";
            theNewJson = "{new: 'json'}";

            service.Expect(x => x.ToJson(test)).Return(theOriginalJson);
            service.Expect(x => x.ToJson(test)).Return(theNewJson);

            manager = new TestStateManager(service, test);
            // setting the pre-condition here
            manager.CurrentJson.ShouldEqual(theOriginalJson);

            manager.Version(null);
            // second version of the JSON
            manager.CurrentJson.ShouldEqual(theNewJson);

            manager.RecordSnapshot();
            manager.IsDirty().ShouldBeFalse();

            manager.RegisterListener(listener1);
            manager.RegisterListener(listener2);
            manager.RegisterListener(listener3);

            // After all that, undo
            manager.Undo.Execute(null);
        }