示例#1
0
        public MainWindow()
        {
            _httpClient = new HttpClient(new HttpLoggingHandler()).UseMonstercatApiV2();
            _api        = MonstercatApi.Create(_httpClient);

            var configuration = new ConfigurationBuilder()
                                .AddUserSecrets <MainWindow>()
                                .Build();

            var sectionName = typeof(ApiCredentials).Name;
            var section     = configuration.GetSection(sectionName);

            section.Bind(Credentials);

            InitializeComponent();

            _timer = new DispatcherTimer
            {
                Interval = TimeSpan.FromMilliseconds(250)
            };
            _timer.Tick += timer1_Tick;
        }
示例#2
0
 public void Test_CtorArgsForNull()
 {
     Assert.Throws <ArgumentNullException>(() => MonstercatApi.Create(null));
 }
示例#3
0
 private static IMonstercatApi Create()
 {
     return(MonstercatApi.Create(new HttpClient(new HttpLoggingHandler()).UseMonstercatApiV2()));
 }