コード例 #1
0
        public FilmStoreTest()
        {
            var fake = new Faker();

            _filmDto = new FilmDto()
            {
                Filme_Id   = fake.Random.Int(1, 9999),
                Titulo     = fake.Random.Word(),
                Nota       = fake.Random.Double(0.1, 5),
                Lancamento = fake.Random.Word()
            };

            _filmRepositoryMock = new Mock <IFilmRepository>();

            _filmStore = new FilmStore(_filmRepositoryMock.Object);
        }
コード例 #2
0
        public FilmController()
        {
            _lazyFilmStore = new Lazy <FilmStore>(() =>
            {
                var appDataPath = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();;
                var user        = HttpContext.User.Identity.GetUserName();
                return(FilmStore.Create(appDataPath, user));
            });

            _lazyParserFactory = new Lazy <WebsiteParserFactory>(() =>
            {
                var appDataPath   = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();;
                var settingsStore = SettingsStore.Create(appDataPath);

                return(new WebsiteParserFactory(settingsStore.Settings.UseProxy, settingsStore.Settings.ProxyAddress));
            });
        }