Exemplo n.º 1
0
        public void ConstructedDatabaseIsCreated()
        {
            var thing = new Topology.Database(1, Allocator.Temp);

            Assert.IsTrue(thing.IsCreated);
            Assert.DoesNotThrow(() => thing.Dispose());
            Assert.IsFalse(thing.IsCreated);
        }
Exemplo n.º 2
0
        public void DefaultConstructedDatabaseThrows()
        {
            var database = new Topology.Database();

            Topology.Connection whatever;

            TopologyTestDatabase.NodeList list = new TopologyTestDatabase.NodeList(Allocator.Temp);

            try
            {
                var source = list.CreateNode();
                var dest   = list.CreateNode();

                Assert.Throws <IndexOutOfRangeException>(() => whatever = database[0]);

                Assert.Throws <Exception>(() => database.Connect(ref list, 0, source, sourcePort: default, dest, destinationPort: default));
Exemplo n.º 3
0
 public TopologyTestDatabase(Allocator allocator)
 {
     Nodes       = new NodeList(Allocator.Persistent);
     Connections = new Topology.Database(0, Allocator.Persistent);
 }