Exemplo n.º 1
0
        public void RequestEntry_EntryGrantedScenario_CorrectAmountOfCalls()
        {
            //Request access
            _userValidationFake.ValidateEntryRequest(100).Returns(true);
            _doorControl.RequestEntry(100);

            //Wait some amount of time
            Thread.Sleep(1);

            //Simulate door closing
            _doorFake.Close();
            _doorControl.DoorClosed();

            _doorFake.Received(1).Close();
        }
Exemplo n.º 2
0
        public void RequestEntry_EntryGrantedScenario_CorrectAmountOfCalls()
        {
            //Request access
            _userValidationFake.ValidateEntryRequestReturnValue = true; //Any id will be valid
            _doorControl.RequestEntry(100);

            //Wait some amount of time
            Thread.Sleep(1);

            //Simulate door closing
            _doorFake.Close();
            _doorControl.DoorClosed();

            Assert.That(_doorFake.CloseCalledCount, Is.EqualTo(1));
        }