public void TestAutoDoorCloser() { gridTerminalSystem = MockRepository.GenerateStub <IMyGridTerminalSystem>(); doorManager = new Program.DoorManager(gridTerminalSystem); var terminalDoors = new List <IMyTerminalBlock>(); var door = new MyDoor(); gridTerminalSystem.Stub(x => x.GetBlocksOfType <IMyTerminalBlock>(new List <IMyTerminalBlock>(), Program.DoorManager.IsAutoclosedDoor)).Do( new Action <object>(x => terminalDoors.Add(door))); Assert.AreEqual(1, doorManager.GetStoredDoorsCount); }