예제 #1
0
        public void ItDoesntCrashIfNobodyIsListeningForDoneWaiting()
        {
            var unity            = Substitute.For <UnityObject>();
            var conflictResolver = Substitute.For <ConflictResolver>();
            var unit             = new StandardUnit(conflictResolver, unity);

            unit.NotReadyForCommand();
        }
        public void ItDoesntCrashIfNobodyIsListeningForDoneWaiting()
        {
            var unity = Substitute.For<UnityObject>();
            var conflictResolver = Substitute.For<ConflictResolver>();
            var unit = new StandardUnit(conflictResolver, unity);

            unit.NotReadyForCommand();
        }
        public void ItFiresDoneWaitingWhenNotReadyForACommand()
        {
            var unity = Substitute.For<UnityObject>();
            var conflictResolver = Substitute.For<ConflictResolver>();
            var unit = new StandardUnit(conflictResolver, unity);

            bool doneWaiting = false;
            unit.DoneWaiting += () => doneWaiting = true;

            unit.NotReadyForCommand();

            Assert.IsTrue(doneWaiting);
        }
예제 #4
0
        public void ItFiresDoneWaitingWhenNotReadyForACommand()
        {
            var unity            = Substitute.For <UnityObject>();
            var conflictResolver = Substitute.For <ConflictResolver>();
            var unit             = new StandardUnit(conflictResolver, unity);

            bool doneWaiting = false;

            unit.DoneWaiting += () => doneWaiting = true;

            unit.NotReadyForCommand();

            Assert.IsTrue(doneWaiting);
        }