Beispiel #1
0
        public void GetConnectionsSizeTest()
        {
            Receptacle target = new Receptacle(name, interfaceName, isMultiple);
            int        actual;
            int        expected;

            for (int i = 0; i < connections.Count; i++)
            {
                target.AddConnections(connections[i]);
                actual   = target.GetConnectionsSize();
                expected = i + 1;
                Assert.AreEqual(expected, actual);
            }

            int id = target.AddConnections(connections[0]);

            expected = connections.Count + 1;
            actual   = target.GetConnectionsSize();
            Assert.AreEqual(expected, actual);

            target.RemoveConnetions(id);
            expected = connections.Count;
            actual   = target.GetConnectionsSize();
            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void RemoveConnetionsTest3()
        {
            Receptacle target = new Receptacle(name, interfaceName, isMultiple);
            int        id     = Int32.MaxValue;
            bool       actual = target.RemoveConnetions(id);

            Assert.AreEqual(false, actual);
        }
Beispiel #3
0
        public void RemoveConnetionsTest()
        {
            Receptacle         target     = new Receptacle(name, interfaceName, isMultiple);
            MarshalByRefObject connection = connections[0];
            int  id     = target.AddConnections(connection);
            bool actual = target.RemoveConnetions(id);

            Assert.AreEqual(true, actual);
        }