public void CanCreateInstance() { var dateTimeManager = Substitute.For <IDateTimeManager>(); var logger = Substitute.For <ILogger>(); var repository = Substitute.For <IRunnerRepository>(); var decorator = new LoggingRunnerRepository(dateTimeManager, logger, repository); Assert.NotNull(decorator); }
public void GetAll_calles_repository_Get() { var dateTimeManager = Substitute.For <IDateTimeManager>(); var logger = Substitute.For <ILogger>(); var repository = Substitute.For <IRunnerRepository>(); var decorator = new LoggingRunnerRepository(dateTimeManager, logger, repository); decorator.GetAll(); repository.Received().GetAll(); }
public void GetIfHasNoTimeWithCategory_calles_repository_Get() { var dateTimeManager = Substitute.For <IDateTimeManager>(); var logger = Substitute.For <ILogger>(); var repository = Substitute.For <IRunnerRepository>(); var decorator = new LoggingRunnerRepository(dateTimeManager, logger, repository); decorator.GetIfHasNoTimeWithCategory("1234567890"); repository.Received().GetIfHasNoTimeWithCategory("1234567890"); }
public void SingleOrDefault_calles_repository_Get() { var dateTimeManager = Substitute.For <IDateTimeManager>(); var logger = Substitute.For <ILogger>(); var repository = Substitute.For <IRunnerRepository>(); var decorator = new LoggingRunnerRepository(dateTimeManager, logger, repository); decorator.SingleOrDefault(_ => true); repository.ReceivedWithAnyArgs().SingleOrDefault(_ => true); }
public void RemoveRange_calles_repository_Get() { var dateTimeManager = Substitute.For <IDateTimeManager>(); var logger = Substitute.For <ILogger>(); var repository = Substitute.For <IRunnerRepository>(); var decorator = new LoggingRunnerRepository(dateTimeManager, logger, repository); var runners = new[] { new Runner(), new Runner(), new Runner() }; decorator.RemoveRange(runners); repository.Received().RemoveRange(runners); }