Esempio n. 1
0
        public void DebugDispatcher_AddWithWriter()
        {
            var debugDispatcher = new DebugDispatcherImplementation();
            var workspaceID     = Guid.NewGuid();
            var writer          = new Mock <IDebugWriter>();

            debugDispatcher.Add(workspaceID, writer.Object);

            var theWriter = debugDispatcher.Get(workspaceID);

            Assert.AreEqual(writer.Object, theWriter);
        }
Esempio n. 2
0
        public void DebugDispatcher_GetWithValidID()
        {
            var debugDispatcher = new DebugDispatcherImplementation();
            var workspaceID     = Guid.NewGuid();
            var writer          = new Mock <IDebugWriter>();

            debugDispatcher.Add(workspaceID, writer.Object);

            var result = debugDispatcher.Get(workspaceID);

            Assert.AreSame(writer.Object, result);
        }
Esempio n. 3
0
        public void DebugDispatcher_RemoveWithValidID()
        {
            var debugDispatcher = new DebugDispatcherImplementation();
            var workspaceID     = Guid.NewGuid();
            var writer          = new Mock <IDebugWriter>();

            debugDispatcher.Add(workspaceID, writer.Object);

            debugDispatcher.Remove(workspaceID);
            var theWriter = debugDispatcher.Get(workspaceID);

            Assert.IsNull(theWriter);
        }
Esempio n. 4
0
        public void DebugDispatcher_AddAfterShutdown_DoesNotAdd()
        {
            var debugDispatcher = new DebugDispatcherImplementation();
            var workspaceID     = Guid.NewGuid();
            var writer          = new Mock <IDebugWriter>();

            Assert.AreEqual(0, debugDispatcher.Count);

            debugDispatcher.Shutdown();
            debugDispatcher.Add(workspaceID, writer.Object);

            var theWriter = debugDispatcher.Get(workspaceID);

            Assert.AreEqual(0, debugDispatcher.Count);
            Assert.AreEqual(null, theWriter);
        }