예제 #1
0
        public void PropertyChanged_RemoveHandler_()
        {
            // AssertThatChangeNotificationIsRaisedBy doesn't seem to remove
            // handlers so this is just to get 100% coverage.
            FileBackingStoreService test = BuildDefaultFileBackingStoreService();

            test.PropertyChanged += delegate { };
            test.PropertyChanged -= delegate { };
        }
예제 #2
0
        public void Initialize_WhenLoadOnStartup_Loads()
        {
            _mockLocator.Setup(x => x.LoadOnStartup).Returns(true);
            _mockLocator.Setup(x => x.Path).Returns(ExamplePath);

            FileBackingStoreService test = BuildDefaultFileBackingStoreService();

            test.Initialize();

            _mockSerializer.Verify(x => x.Load(It.IsAny <Stream>(), It.IsAny <IEnumerable <Type> >()));
        }
예제 #3
0
        public void Initialize_WorkspaceFileIsMissing_KeepsDefaultWorkspace(Type exceptionType)
        {
            _mockLocator.Setup(x => x.LoadOnStartup).Returns(true);
            _mockLocator.Setup(x => x.Path).Returns(ExamplePath);
            _mockSerializer.Setup(x => x.Load(It.IsAny <Stream>(), It.IsAny <IEnumerable <Type> >())).Throws(
                (Exception)Activator.CreateInstance(exceptionType));

            FileBackingStoreService test = BuildDefaultFileBackingStoreService();

            test.Initialize();

            Assert.Same(_workspace, test.Workspace);
        }