public void AddSanction_GetAddedSanction() { //Arrange var sanctionFacade = new SanctionFacade(_sanctionRepository, _userRepository, _publisher.Object); //Act sanctionFacade.AddSanction("Some rule", _testUserId, _adminId, SanctionType.NotAllowToEditProfile); //Assert Assert.AreEqual(1, sanctionFacade.GetAll().ToList().Count); }
public void CheckActivityOfExpiredSanction_GetInactiveSanction() { //Arrange var sanctionFacade = new SanctionFacade(_sanctionRepository, _userRepository, _publisher.Object); var sanctionId = sanctionFacade.AddSanction("Some rule", _testUserId, _adminId, SanctionType.NotAllowToEditProfile, DateTimeOffset.Now.AddMilliseconds(1)); //Act Thread.Sleep(4); //Assert Assert.AreEqual(false, sanctionFacade.GetAll().ToList()[0].IsActive); }