Exemple #1
0
        public void CanCreateInstance()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            Assert.NotNull(dec);
        }
Exemple #2
0
        public void GetAllWithRelatedfalse_Calles_BaseRepository_GetAllWithRelatedfalse()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            dec.GetAllWithCategories(false);

            baseRepository.Received().GetAllWithCategories(false);
        }
Exemple #3
0
        public void GetAlltrue_Calles_BaseRepository_GetAlltrue()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            dec.GetAll(true);

            baseRepository.Received().GetAll(true);
        }
Exemple #4
0
        public void GetMAX_Calles_BaseRepository_GetMAX()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            dec.Get(int.MaxValue);

            baseRepository.Received().Get(int.MaxValue);
        }
Exemple #5
0
        public void SingleOrDefault_Calles_BaseRepository_SingleOrDefault()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            Expression <Func <Runner, bool> > predicate = _ => false;

            dec.SingleOrDefault(predicate);

            baseRepository.ReceivedWithAnyArgs().SingleOrDefault(null);
            baseRepository.Received().SingleOrDefault(predicate);
        }
Exemple #6
0
        public void Remove_Calles_BaseRepository_Remove()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            var runner = new Runner {
                Id = 68430
            };

            dec.Remove(runner);

            baseRepository.ReceivedWithAnyArgs().Remove(null);
            baseRepository.Received().Remove(runner);
        }
Exemple #7
0
        public void AddRange_Calles_BaseRepository_AddRange()
        {
            var baseRepository = Substitute.For <IRunnerRepository>();
            var dec            = new EmptyRunnerRepositoryDecoratorSubClass(baseRepository);

            var runners = new[]
            {
                new Runner {
                    Id = 68430
                },
                new Runner {
                    Id = 356
                },
            };

            dec.AddRange(runners);

            baseRepository.ReceivedWithAnyArgs().AddRange(null);
            baseRepository.Received().AddRange(runners);
        }