public void ShouldGetApplicationAsynchronously()
        {
            manualResetEvent = new ManualResetEvent(false);

            var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken);

            ApplicationOptions options = new ApplicationOptions();
            var originalApplication = client.AddApplication(Utilities.MakeRandomFriendlyName(), options);

            Assert.IsNotNull(originalApplication.Sid);

            Application result = null;

            client.GetApplication(originalApplication.Sid, app => {
                result = app;
                manualResetEvent.Set();
            });

            manualResetEvent.WaitOne();

            Assert.IsNotNull(result);
            Assert.IsNull(result.RestException);
            Assert.AreEqual(originalApplication.Sid, result.Sid);

            client.DeleteApplication(result.Sid); //cleanup
        }
        public void ShouldAddNewApplicationAsynchronously()
        {
            RestRequest savedRequest = null;
            mockClient.Setup(trc => trc.ExecuteAsync<Application>(It.IsAny<RestRequest>(), It.IsAny<Action<Application>>()))
                .Callback<RestRequest, Action<Application>>((request, action) => savedRequest = request);
            var client = mockClient.Object;
            manualResetEvent = new ManualResetEvent(false);
            var options = new ApplicationOptions();
            var friendlyName = Utilities.MakeRandomFriendlyName();

            client.AddApplication(friendlyName, options, app =>
            {
                manualResetEvent.Set();
            });
            manualResetEvent.WaitOne(1);

            mockClient.Verify(trc => trc.ExecuteAsync<Application>(It.IsAny<RestRequest>(), It.IsAny<Action<Application>>()), Times.Once);
            
            Assert.IsNotNull(savedRequest);
            Assert.AreEqual("Accounts/{AccountSid}/Applications.json", savedRequest.Resource);
            Assert.AreEqual("POST", savedRequest.Method);
            Assert.AreEqual(1, savedRequest.Parameters.Count);
            var friendlyNameParam = savedRequest.Parameters.Find(x => x.Name == "FriendlyName");
            Assert.IsNotNull(friendlyNameParam);
            Assert.AreEqual(friendlyName, friendlyNameParam.Value);
        }
        public async Task ShouldAddNewApplication()
        {
            RestRequest savedRequest = null;

            var tcs = new TaskCompletionSource<Application>();
            tcs.SetResult(new Application());

            mockClient.Setup(trc => trc.Execute<Application>(It.IsAny<RestRequest>()))
                .Callback<RestRequest>((request) => savedRequest = request)
                .Returns(tcs.Task);
            var client = mockClient.Object;
            var options = new ApplicationOptions();
            var friendlyName = Utilities.MakeRandomFriendlyName();

            await client.AddApplicationAsync(friendlyName, options);

            mockClient.Verify(trc => trc.Execute<Application>(It.IsAny<RestRequest>()), Times.Once);
            Assert.IsNotNull(savedRequest);
            Assert.AreEqual("Accounts/{AccountSid}/Applications.json", savedRequest.Resource);
            Assert.AreEqual("POST", savedRequest.Method);
            Assert.AreEqual(1, savedRequest.Parameters.Count);
            var friendlyNameParam = savedRequest.Parameters.Find(x => x.Name == "FriendlyName");
            Assert.IsNotNull(friendlyNameParam);
            Assert.AreEqual(friendlyName, friendlyNameParam.Value);
        }
Example #4
0
        public void onReady()
        {
            setConnectButtonState("Disconnect", true, true);
                       
            interAppBus_ = controller_.getInterApplicationBus();
            interAppBus_.addSubscribeListener((uuid, topic) => {
                bool exists = false;

                if (!subscriptionMap.TryGetValue(topic, out exists)) {
                    subscriptionMap.Add(topic, true);
                    if (subscriptionCallback != null) 
                        subscriptionCallback();
                }
            });
            Console.WriteLine("OnReady.");
            ApplicationOptions mainAppOptions = new ApplicationOptions(htmlDemoUuid_, htmlDemoUuid_, "https://developer.openf.in/htmlinterappcommdemo/1/index.html");
            mainAppOptions.Version = "v1.0.0.0b";
            mainAppOptions.IsAdmin = true;

            WindowOptions mainWindowOptions = mainAppOptions.MainWindowOptions;
            mainWindowOptions.AutoShow = true;
            mainWindowOptions.DefaultLeft = 100;
            mainWindowOptions.DefaultTop = 100;
            mainWindowOptions.DefaultWidth = 510;
            mainWindowOptions.DefaultHeight = 350;
            mainWindowOptions.Maximizable = false;
            mainWindowOptions.ShowTaskbarIcon = true;

            AckCallback afterAppCreation = (ack) =>
            {
                Console.WriteLine("afterAppCreation");
                Console.WriteLine(ack.getJsonObject().ToString());
                AckCallback afterRun = (runAck) =>
                {
                    Console.WriteLine("afterRun");
                    Console.WriteLine(runAck.getJsonObject().ToString());
                };

                Console.WriteLine("app.run()");
                // Using same callback for success and error in case app is already running
                htmlApplication_.run(afterRun, afterRun);

            };


            // Using same callback for success and error in case app already exists
            Console.WriteLine("Creating App");
            htmlApplication_ = new Application(mainAppOptions, controller_, afterAppCreation, afterAppCreation);
            htmlApplication_.addEventListener("closed", (ack) => {
                controller_.disconnect();
                System.Windows.Forms.Application.ExitThread();
            });
        }
        public void ShouldAddNewApplication()
        {
            var client = new TwilioRestClient(Credentials.AccountSid, Credentials.AuthToken);
            
            ApplicationOptions options = new ApplicationOptions();

            var result = client.AddApplication(Utilities.MakeRandomFriendlyName(), options);

            Assert.IsNotNull(result);
            Assert.IsNull(result.RestException);
            Assert.IsNotNull(result.Sid);

            client.DeleteApplication(result.Sid); //cleanup
        }
		async void RunGame(TypeInfo value)
		{
			currentApplication?.Exit();
			if (value == null) return;
			await semaphoreSlim.WaitAsync();
			//urho will destroy our Panel on Exit so let's create it for each sample
			var urhoSurface = new Panel { Dock = DockStyle.Fill };
			//TODO: capture mouse inside the control
			WindowsFormsHost.Child = urhoSurface;
			WindowsFormsHost.Focus();
			urhoSurface.Focus();
			await Task.Yield();
			var appOptions = new ApplicationOptions(assetsFolder: "Data")
				{
					ExternalWindow = RunInSdlWindow.IsChecked.Value ? IntPtr.Zero : urhoSurface.Handle,
					LimitFps = false, //true means "limit to 200fps"
				};
			currentApplication = Urho.Application.CreateInstance(value.Type, appOptions);
			currentApplication.Run();
			semaphoreSlim.Release();
		}
Example #7
0
        public void ShouldAddNewApplication()
        {
            IRestRequest savedRequest = null;
            mockClient.Setup(trc => trc.Execute<Application>(It.IsAny<IRestRequest>()))
                .Callback<IRestRequest>((request) => savedRequest = request)
                .Returns(new Application());
            var client = mockClient.Object;
            var options = new ApplicationOptions();
            var friendlyName = Utilities.MakeRandomFriendlyName();

            client.AddApplication(friendlyName, options);

            mockClient.Verify(trc => trc.Execute<Application>(It.IsAny<IRestRequest>()), Times.Once);
            Assert.IsNotNull(savedRequest);
            Assert.AreEqual("Accounts/{AccountSid}/Applications.json", savedRequest.Resource);
            Assert.AreEqual(Method.POST, savedRequest.Method);
            Assert.AreEqual(1, savedRequest.Parameters.Count);
            var friendlyNameParam = savedRequest.Parameters.Find(x => x.Name == "FriendlyName");
            Assert.IsNotNull (friendlyNameParam);
            Assert.AreEqual (friendlyName, friendlyNameParam.Value);
        }
        public override void OnCreate()
        {
            base.OnCreate();

            Options = new ApplicationOptions();
            Runner.Instance.Options.TimeoutMessage = Resources.GetString(Resource.String.TimeoutMessage);
            Runner.Instance.Options.UsingMessage = Resources.GetString(Resource.String.UsingMessage);
            Runner.Instance.Options.ClassMessage = Resources.GetString(Resource.String.ClassMessage);

            _preferenceChangeListener = new SharedPreferenceChangeListener(this);

            var preferences = PreferenceManager.GetDefaultSharedPreferences(this);
            preferences.RegisterOnSharedPreferenceChangeListener(_preferenceChangeListener);

            if (preferences.GetBoolean(PreferenceKeys.SaveNamespaces, false))
            {
                string namespaces = preferences.GetString(PreferenceKeys.SavedNamespaces, "");

                if (!string.IsNullOrEmpty(namespaces))
                    Runner.Instance.Options.DefaultNamespaces = new List<string>(namespaces.Split(','));
            }
        }
Example #9
0
 protected StereoApplication(ApplicationOptions opts) : base(opts)
 {
 }
Example #10
0
 public WorldView(ApplicationOptions options = null) : base(options)
 {
 }
Example #11
0
 public HelloGUI(ApplicationOptions options = null) : base(options)
 {
 }
Example #12
0
 public SignedDistanceFieldText(ApplicationOptions options = null) : base(options)
 {
 }
Example #13
0
 public UrhoApp(ApplicationOptions opts) : base(opts)
 {
 }
Example #14
0
		public Ragdolls(ApplicationOptions options = null) : base(options) { }
Example #15
0
 public ARCoreSample(ApplicationOptions options) : base(options)
 {
 }
Example #16
0
 private static ApplicationOptions SetOptions(ApplicationOptions options)
 {
     options.TouchEmulation = true;
     return(options);
 }
		public Urho2DPhysics(ApplicationOptions options = null) : base(options) { }
		public Urho2DSpriterAnimation(ApplicationOptions options = null) : base(options) { }
		public SkeletalAnimation(ApplicationOptions options = null) : base(options) { }
Example #20
0
		public Actions(ApplicationOptions options = null) : base(options) { }
Example #21
0
		public StaticScene(ApplicationOptions options = null) : base(options) { }
		public DynamicGeometry(ApplicationOptions options = null) : base(options) { }
Example #23
0
		public BasicTechniques(ApplicationOptions options = null) : base(options) { }
		public LightAnimation(ApplicationOptions options = null) : base(options) { }
Example #25
0
 public SearchController(IOptions <ApplicationOptions> applicationOptions, ElasticsearchClient elasticsearchClient)
 {
     this.applicationOptions  = applicationOptions.Value;
     this.elasticsearchClient = elasticsearchClient;
 }
Example #26
0
		public CrowdNavigation(ApplicationOptions options = null) : base(options) { }
Example #27
0
		public Charts(ApplicationOptions options = null) : base(SetOptions(options)) {}
Example #28
0
 public UIDrag(ApplicationOptions options = null) : base(options)
 {
 }
		public SceneAndUILoad(ApplicationOptions options = null) : base(options) { }
Example #30
0
		protected Sample (ApplicationOptions options = null) : base (options) {}
Example #31
0
 public TGame Run <TGame>(ApplicationOptions options = null) where TGame : Urho.Application
 {
     return((TGame)Run(typeof(TGame), options));
 }
		public Urho2DConstraints(ApplicationOptions options = null) : base(options) { }
Example #33
0
 public HelloWorldApplication(ApplicationOptions opts) : base(opts)
 {
 }
Example #34
0
		public HelloWorld(ApplicationOptions options = null) : base(options) {}
 //###################################################################################################################
 /// <summary>
 /// Application constructor.
 /// </summary>
 /// <param name="opts"> options that are used to launch application </param>
 public CollisionApplication(ApplicationOptions opts) : base(opts)
 {
 }
		public CharacterDemo(ApplicationOptions options = null) : base(options) { }
Example #37
0
 public Water(ApplicationOptions options = null) : base(options)
 {
 }
		public PhysicsStressTest(ApplicationOptions options = null) : base(options) { }
 public ApplicationThreadingProfiler(ICollector collector, IOptionAccessor <ApplicationOptions> optionAccessor)
 {
     _collector          = collector ?? throw new ArgumentNullException(nameof(collector));
     _applicationOptions = optionAccessor.Value;
 }
Example #40
0
 public ThreeDModelViewer(ApplicationOptions options) : base(options)
 {
 }
Example #41
0
 //private Token _token;
 public BimProjectFoldersApi(Token token, ApplicationOptions options) : base(token, options)
 {
     ContentType = "application/json";
     //_token = token;
 }
		public MaterialAnimation(ApplicationOptions options = null) : base(options) { }
 public MemoryBookDbContextFactory()
 {
     this.applicationOptions = CreateConfiguration().GetSection("Application").Get <ApplicationOptions>();
 }
Example #44
0
 public Task ImportProject(ProjectImportedEvent @event, ApplicationOptions options)
 {
     return(Task.CompletedTask);
 }
Example #45
0
 protected Sample(ApplicationOptions options = null) : base(options)
 {
 }
 public PBRMaterials(ApplicationOptions options = null) : base(options)
 {
 }
Example #47
0
 public Charts(ApplicationOptions options = null) : base(SetOptions(options))
 {
 }
Example #48
0
 public CreateIdentityHandler(AppDbContext identityDBContext, IOptions <ApplicationOptions> options, UtilsService utils)
 {
     this.IdentityDBContext = identityDBContext;
     this.Utils             = utils;
     this.Options           = options?.Value ?? throw new NullReferenceException(nameof(ApplicationOptions));
 }
Example #49
0
 public RenderToTexture(ApplicationOptions options = null) : base(options)
 {
 }
Example #50
0
 public MyGame(ApplicationOptions opts) : base(opts)
 {
 }
Example #51
0
 public Actions(ApplicationOptions options = null) : base(options)
 {
 }
Example #52
0
        public static ISomaticVariantCaller CreateMockVariantCaller(VcfFileWriter vcfWriter, ApplicationOptions options, ChrReference chrRef, MockAlignmentExtractor mockAlignmentExtractor, IStrandBiasFileWriter biasFileWriter = null, string intervalFilePath = null)
        {
            var config = new AlignmentSourceConfig
            {
                MinimumMapQuality  = options.MinimumMapQuality,
                OnlyUseProperPairs = options.OnlyUseProperPairs,
            };


            //var mateFinder = options.StitchReads ? new AlignmentMateFinder() : null;
            AlignmentMateFinder mateFinder = null;
            var alignmentSource            = new AlignmentSource(mockAlignmentExtractor, mateFinder, config);
            var variantFinder      = new CandidateVariantFinder(options.MinimumBaseCallQuality, options.MaxSizeMNV, options.MaxGapBetweenMNV, options.CallMNVs);
            var coverageCalculator = new CoverageCalculator();

            var alleleCaller = new AlleleCaller(new VariantCallerConfig
            {
                IncludeReferenceCalls        = options.OutputgVCFFiles,
                MinVariantQscore             = options.MinimumVariantQScore,
                MaxVariantQscore             = options.MaximumVariantQScore,
                VariantQscoreFilterThreshold = options.FilteredVariantQScore > options.MinimumVariantQScore ? options.FilteredVariantQScore : (int?)null,
                MinCoverage                = options.MinimumDepth,
                MinFrequency               = options.MinimumFrequency,
                EstimatedBaseCallQuality   = options.AppliedNoiseLevel == -1 ? options.MinimumBaseCallQuality : options.AppliedNoiseLevel,
                StrandBiasModel            = options.StrandBiasModel,
                StrandBiasFilterThreshold  = options.StrandBiasAcceptanceCriteria,
                FilterSingleStrandVariants = options.FilterOutVariantsPresentOnlyOneStrand,
                ChrReference               = chrRef
            },
                                                coverageCalculator: coverageCalculator,
                                                variantCollapser: options.Collapse ? new VariantCollapser(null, coverageCalculator) : null);

            var stateManager = new RegionStateManager(
                expectStitchedReads: mockAlignmentExtractor.SourceIsStitched,
                trackOpenEnded: options.Collapse, trackReadSummaries: options.CoverageMethod == CoverageMethod.Approximate);

            //statmanager is an allele source
            Assert.Equal(0, stateManager.GetAlleleCount(1, AlleleType.A, DirectionType.Forward));


            return(new SomaticVariantCaller(
                       alignmentSource,
                       variantFinder,
                       alleleCaller,
                       vcfWriter,
                       stateManager,
                       chrRef,
                       null,
                       biasFileWriter));
        }
Example #53
0
		public ConsoleInput(ApplicationOptions options = null) : base(options) { }
Example #54
0
 public AppDebug(ApplicationOptions options = null) : base(options)
 {
 }
Example #55
0
		private static ApplicationOptions SetOptions(ApplicationOptions options)
		{
			options.TouchEmulation = true;
			return options;
		}
Example #56
0
 public SoundEffects(ApplicationOptions options = null) : base(options)
 {
 }
Example #57
0
		public PBRMaterials(ApplicationOptions options = null) : base(options) { }
Example #58
0
 public MockFactoryWithDefaults(ApplicationOptions options) : base(options)
 {
 }
Example #59
0
 public Decals(ApplicationOptions options = null)
     : base(options)
 {
 }
Example #60
0
 public EarthGlobeView(ApplicationOptions options = null) : base(options) { }