public void AddObserver() { identity.Server = server; // create some connections var connection1 = new NetworkConnection(tconn42); var connection2 = new NetworkConnection(tconn43); // call OnStartServer so that observers dict is created identity.StartServer(); // call AddObservers identity.AddObserver(connection1); identity.AddObserver(connection2); Assert.That(identity.observers, Is.EquivalentTo(new[] { connection1, connection2 })); // adding a duplicate connectionId shouldn't overwrite the original identity.AddObserver(connection1); Assert.That(identity.observers, Is.EquivalentTo(new[] { connection1, connection2 })); }