public void Remove_Null()
        {
            var dictionary = new BidirectionalDictionary <string, string> ();
            var ex         = Assert.Throws <ArgumentNullException> (() => dictionary.Remove(null));

            Assert.AreEqual("key", ex.ParamName);
        }
        public void Remove()
        {
            var dictionary = new BidirectionalDictionary <int, string> ();

            dictionary.Add(42, String1);
            Assert.IsTrue(dictionary.Remove(42));
            Assert.IsFalse(dictionary.ContainsKey(42));
        }
    public void RemoveTest()
    {
        var dict = new BidirectionalDictionary <char, int>();

        dict.Add('A', 1);
        dict.Add('B', 2);

        Assert.False(dict.Remove('C'));
        Assert.AreEqual(2, dict.Count);

        Assert.False(dict.Remove(3));
        Assert.AreEqual(2, dict.Count);

        Assert.True(dict.Remove(2));
        Assert.AreEqual(1, dict.Count);

        Assert.False(dict.Remove('B'));
        Assert.AreEqual(1, dict.Count);

        Assert.True(dict.Remove('A'));
        Assert.AreEqual(0, dict.Count);

        Assert.False(dict.Remove(1));
        Assert.AreEqual(0, dict.Count);
    }
            protected override void OnReceiveInternalData(InternalMessages type, CSteamID clientSteamID)
            {
                switch (type)
                {
                case InternalMessages.CONNECT:
                    if (steamToMirrorIds.Count >= maxConnections)
                    {
                        SendInternal(clientSteamID, InternalMessages.DISCONNECT);
                        return;
                    }

                    SendInternal(clientSteamID, InternalMessages.ACCEPT_CONNECT);

                    int connectionId = nextConnectionID++;
                    steamToMirrorIds.Add(clientSteamID, connectionId);
                    OnConnected.Invoke(connectionId);
                    Debug.Log($"Client with SteamID {clientSteamID} connected. Assigning connection id {connectionId}");
                    break;

                case InternalMessages.DISCONNECT:
                    if (steamToMirrorIds.TryGetValue(clientSteamID, out int connId))
                    {
                        OnDisconnected.Invoke(connId);
                        CloseP2PSessionWithUser(clientSteamID);
                        steamToMirrorIds.Remove(clientSteamID);
                        Debug.Log($"Client with SteamID {clientSteamID} disconnected.");
                    }
                    else
                    {
                        OnReceivedError.Invoke(-1, new Exception("ERROR Unknown SteamID"));
                    }

                    break;

                default:
                    Debug.Log("Received unknown message type");
                    break;
                }
            }
        public void Remove_Fact()
        {
            _dictionary.Remove("FirstValue", "FirstLookupValue");

            var results = _dictionary.GetByFirst("FirstValue");
            var result  = results.ToList().Contains("FirstValue");

            result.Should().BeFalse();

            results = _dictionary.GetBySecond("FirstLookupValue");
            result  = results.ToList().Contains("FirstLookupValue");
            result.Should().BeFalse();
        }
        public void Remove_NotFound()
        {
            var dictionary = new BidirectionalDictionary <int, string> ();

            Assert.IsFalse(dictionary.Remove(42));
        }