public void matches_by_key_alone() { var key = new NavigationKey("something"); var matcher = new ByName("something"); matcher.Matches(key).ShouldBeTrue(); }
/// <summary> /// Clears the symbol collections. /// </summary> public void Clear() { ByLocation.Clear(); ByName.Clear(); ByValue.Clear(); Symbols.Clear(); }
public void default_key() { var matcher = new ByName("something"); matcher.DefaultKey().ShouldBeOfType <NavigationKey>() .Key.ShouldEqual("something"); }
/// <summary> /// Creates a <see cref="CompositeRootAssemblyFinder"/> representing the assembly specifications given by <see cref="ByName"/> and /// <see cref="ByFile"/>. /// </summary> /// <returns>A <see cref="CompositeRootAssemblyFinder"/> for the assembly specifications.</returns> public CompositeRootAssemblyFinder CreateRootAssemblyFinder(IAssemblyLoader assemblyLoader) { var namedFinder = ByName.CreateRootAssemblyFinder(assemblyLoader); var filePatternFinder = ByFile.CreateRootAssemblyFinder(assemblyLoader); return(new CompositeRootAssemblyFinder(new IRootAssemblyFinder[] { namedFinder, filePatternFinder })); }
public void negative_test_by_key_alone() { var key = new NavigationKey("something"); var matcher = new ByName("else"); matcher.Matches(key).ShouldBeFalse(); }
public void negative_test_by_localization_key() { var key = new NavigationKey("something"); var matcher = new ByName("OtherKey:something"); matcher.Matches(key).ShouldBeFalse(); }
public void matches_by_localizer_key() { var key = new NavigationKey("something"); var matcher = new ByName("NavigationKey:something"); matcher.Matches(key).ShouldBeTrue(); }
public T this[string name] { get { return((ByName.ContainsKey(name)) ? ByName[name] : default(T)); } }
public void ByName_Should_Map(ByName byName, List <Item> items) { _storage.Setup(m => m.SearchByName(It.IsAny <int>(), It.IsAny <string>())).ReturnsAsync(items); var results = _sut.SearchByName(byName).Result; results.Count.ShouldBe(items.Count); }
public static void Main() { ByName.Test(); PrivateByName.Test(); NullName.Test(); EmptyName.Test(); NoValueName.Test(); WithBindingFlags.Test(); UnknownBindingFlags.Test(BindingFlags.Public); UnknownBindingFlagsAndName.Test(BindingFlags.Public, "DoesntMatter"); NonExistingName.Test(); TestNullType(); TestNoValue(); IgnoreCaseBindingFlags.Test(); FailIgnoreCaseBindingFlags.Test(); UnsupportedBindingFlags.Test(); MemberOnNestedType.Test(); }
public void ByName_Should_Call_Method(ByName byName) { _sut.SearchByName(byName); _storage.Verify(x => x.SearchByName(It.IsAny <int>(), It.IsAny <string>()), Times.Once); }
public async Task <List <SearchViewModel> > SearchByName(ByName byName) { var results = await _repository.SearchByName(1, byName.SearchValue); return(SearchViewModel.FromItemModels(results)); }
public void default_key() { var matcher = new ByName("something"); matcher.DefaultKey().ShouldBeOfType<NavigationKey>() .Key.ShouldEqual("something"); }