示例#1
0
 /// <summary>
 /// Construtor utilizado para instaciar as classes que serão testadas
 /// </summary>
 public ApplicationTest()
 {
     appConfiguration   = new AppConfiguration();
     theCatDBContext    = new TheCatDBContext(appConfiguration);
     theCatAPI          = new TheCatAPIService(appConfiguration);
     imageUrlRepository = new ImageUrlRepository(theCatDBContext);
     breedsRepository   = new BreedsRepository(theCatDBContext, imageUrlRepository);
     categoryRepository = new CategoryRepository(theCatDBContext);
     commandCapture     = new CommandCapture(appConfiguration, theCatAPI, breedsRepository, categoryRepository, imageUrlRepository);
 }
示例#2
0
        /// <summary>
        /// Construtor utilizado para instanciar as classes que serão testadas
        /// </summary>
        public RepositoriesTest()
        {
            appConfiguration = new AppConfiguration();
            var contextDB = new TheCatDBContext(appConfiguration);

            breedsBase = new Breeds("abys", "Abyssinian");
            breedsBase.SetOrigin("Egypt");
            breedsBase.SetTemperament("Active, Energetic, Independent, Intelligent, Gentle");
            breedsBase.SetDescription("The Abyssinian is easy to care for, and a joy to have in your home. They’re affectionate cats and love both people and other animals.");

            categoryBase = new Category(1, "hats");

            imageUrlBase = new ImageUrl("393", "https://cdn2.thecatapi.com/images/393.jpg");
            imageUrlBase.SetWidth(1024);
            imageUrlBase.SetHeight(654);
            imageUrlBase.SetBreeds(breedsBase);
            imageUrlBase.SetCategory(categoryBase);

            imageUrlRepository = new ImageUrlRepository(contextDB);
            breedsRepository   = new BreedsRepository(contextDB, imageUrlRepository);
            categoryRepository = new CategoryRepository(contextDB);
            logEventRepository = new LogEventRepository(contextDB);
        }
 /// <summary>
 /// Construtor da classe: Espera um DBContext responsável por acessar a base e que implementa os
 /// comandos de banco de dados
 /// </summary>
 /// <param name="theCatContext"></param>
 public ImageUrlRepository(TheCatDBContext theCatContext)
 {
     this.theCatContext = theCatContext;
 }
示例#4
0
 /// <summary>
 /// Construtor da classe: Espera um DBContext responsável por acessar a base e que implementa os
 /// comandos de banco de dados
 /// </summary>
 /// <param name="theCatContext"></param>
 public LogEventRepository(TheCatDBContext theCatContext)
 {
     this.theCatContext = theCatContext;
 }
 public BreedsRepository(TheCatDBContext theCatContext, IImageUrlRepositories imageUrlRepository)
 {
     this.theCatContext      = theCatContext;
     this.imageUrlRepository = imageUrlRepository;
 }
 /// <summary>
 /// Construtor da classe: Espera um DBContext responsável por acessar a base e que implementa os
 /// comandos de banco de dados
 /// </summary>
 /// <param name="theCatContext"></param>
 public CategoryRepository(TheCatDBContext theCatContext)
 {
     this.theCatContext = theCatContext;
 }