Ejemplo n.º 1
0
        public PlannerItemsTestFixture() : base()
        {
            TestFixture.AddDefaults(this);
            var mapperConfig = new MapperConfiguration(c => c.AddProfile(new PlannerItemsMappingProfile()));
            var mapper       = new Mapper(mapperConfig);

            this.Register <IMapper>(() => mapper);
            this.AddManyTo(Items, 10);
            repositoryMock = this.Freeze <Mock <IPlannerItemRepository> >();

            repositoryMock
            .Setup(p => p.GetAll())
            .Returns(() => Items.AsAsyncQueryable());

            repositoryMock
            .Setup(m => m.GetByIdAsync(It.IsAny <int>()))
            .ReturnsAsync(Items.First());
        }