public void test_name_filter_is_case_insensitive() { var mockGameObject = new Mock <GameObject>(); mockGameObject .Setup(m => m.name) .Returns("some-layer"); var testObject = new NameQuery("some-layer"); Assert.True(testObject.Match(mockGameObject.Object)); }
public void test_name_doesnt_match_when_gameobject_doesnt_have_the_expected_name() { var mockGameObject = new Mock <GameObject>(); mockGameObject .Setup(m => m.name) .Returns("some-other-layer"); var testObject = new NameQuery("some-layer"); Assert.False(testObject.Match(mockGameObject.Object)); }
public void OnPostRideSearch() { Handler = "RideSearch"; if (NameQuery == null) { NameQuery = ""; } foreach (Ride ride in Rides) { if (ride.Name.ToLower().Contains(NameQuery.ToLower())) { if (ride.Category.Id == CategoryQuery) { if ((int)ride.Status == StatusQuery) { FilteredRides.Add(ride); } } } } }
//[LuisIntent("Hello")] public async Task Hello2(IDialogContext context, LuisResult result) { if (HasBeenIdentified) { string message = $"Well hello {Name}! Welcome back"; await context.PostAsync(message); context.Wait(MessageReceived); } else { string message = "Well hello to you too! Provide your data and I will remember you, ok?"; await context.PostAsync(message); var nameQuery = new NameQuery(); var nameFormDialog = new FormDialog <NameQuery>(nameQuery, this.BuildNameForm, FormOptions.PromptInStart, result.Entities); context.Call(nameFormDialog, this.ResumeAfterNameFormDialog); } }
public IActionResult Index(NameQuery query) { query.PageSize = 50; return(View(_nameManager.Load(query))); }