Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var form = new UnleashForm();

            JsonSerializerTester.Assert(new NewtonsoftJson7Serializer());

            settings = new UnleashSettings
            {
                UnleashApi = new Uri("http://unleash.herokuapp.com/"),
                //UnleashApi = new Uri("http://localhost:4242/"),
                AppName                = "dotnet-forms-test",
                InstanceTag            = "instance 1",
                SendMetricsInterval    = TimeSpan.FromSeconds(5),
                FetchTogglesInterval   = TimeSpan.FromSeconds(10),
                UnleashContextProvider = new WinFormsContextProvider(form),
                JsonSerializer         = new NewtonsoftJson7Serializer()
            };

            unleash       = new DefaultUnleash(settings);
            form.Unleash  = unleash;
            form.Settings = settings;

            Application.ApplicationExit += (sender, args) =>
            {
                unleash?.Dispose();
            };

            Application.Run(form);
        }
 public UnleashSampleService(
     UnleashSampleServiceState state,
     IUnleashContextProvider unleashContextProvider,
     IUnleash unleash,
     IOptions <UnleashSampleServiceOptions> options,
     ILogger <UnleashSampleService> logger)
 {
     State = state;
     UnleashContextProvider = unleashContextProvider;
     Unleash = unleash;
     Options = options.Value;
     Logger  = logger;
 }
 public UnleashController(ILogger <UnleashController> logger, IUnleash unleash)
 {
     _logger  = logger;
     _unleash = unleash;
 }
 public TestController(IUnleash unleash, IUnleashContextProvider contextProvider)
 {
     Unleash         = unleash;
     ContextProvider = contextProvider;
 }
 public VariantsTest()
 {
     _unleash = new DefaultUnleash(new MockedUnleashSettings());
 }
Example #6
0
        public async Task Setup()
        {
            var factory = new UnleashClientFactory();

            unleash = await factory.CreateClientAsync(new MockedUnleashSettings(), true);
        }
Example #7
0
 public ExampleTests()
 {
     unleash = new DefaultUnleash(new MockedUnleashSettings());
 }
 public TestController(IUnleash unleash)
 {
     Unleash = unleash;
 }
Example #9
0
 public HomeController()
 {
     unleash = WebApiApplication.Unleash;
 }