Ejemplo n.º 1
0
        public void UpdateCallsUpdateOnAllSystems()
        {
            var system = new IntegerSystem();
            var state  = new CobaltState(new ISystem[] { system });

            state.Update(CobaltState.MaxUpdatePerTickSeconds / 2);
            Assert.That(system.NumUpdates, Is.EqualTo(1));
        }
Ejemplo n.º 2
0
        public void UpdateBreaksBiggerUpdatesIntoMultiplePieces()
        {
            var system = new IntegerSystem();
            var state  = new CobaltState(new ISystem[] { system });

            state.Update(CobaltState.MaxUpdatePerTickSeconds * 3);
            Assert.That(system.NumUpdates, Is.EqualTo(3));
        }
Ejemplo n.º 3
0
        public void ConstructorSetsCurrentToLatestInstance()
        {
            var s1 = new CobaltState();

            Assert.That(CobaltState.Current, Is.EqualTo(s1));

            var s2 = new CobaltState();

            Assert.That(CobaltState.Current, Is.EqualTo(s2));
        }