Esempio n. 1
0
        public void ThrowsExceptionWhenRemovingUnknownResolved()
        {
            var table = new UriDisconnectTable();

            var resolved = "unknown456";

            ExceptionAssert.Throws <KeyNotFoundException>(
                ex => ex.Message.Equals(string.Format(Properties.Resources.UriResolvedNotRegisteredForDisconnect, resolved)),
                () => table.Remove(resolved));
        }
Esempio n. 2
0
        public void ThrowsExceptionWhenGettingPlacementConnectorAfterRemove()
        {
            var resolved = new object();

            var shell = Substitute.For <IShell>();

            shell.IsResolvedOpen(resolved).Returns(true);

            var table     = new UriDisconnectTable();
            var connector = Substitute.For <IUriPlacementConnector>();

            table[resolved] = connector;
            table.Remove(resolved);

            ExceptionAssert.Throws <KeyNotFoundException>(
                ex => ex.Message.Equals(string.Format(Properties.Resources.UriResolvedNotRegisteredForDisconnect, resolved)),
                () => connector = table[resolved]);
        }