public override bool DeepEquals(ISymbolStore otherStore) { var other = otherStore as SymbolStoreSequence; return(other != null && _stores.Count == other._stores.Count && _stores.Zip(other._stores, (a, b) => Tuple.Create(a, b)) .All(x => x.Item1.DeepEquals(x.Item2))); }
public SymbolsController(ISymbolStore symbolStore, QuotationContext quotationContext) { if (symbolStore == null) { throw new ArgumentNullException(nameof(symbolStore)); } _symbolStore = symbolStore; _quotationContext = quotationContext; }
/// <summary> /// Recursively enumerates the given store and all of its substores /// </summary> public static IEnumerable <ISymbolStore> GetAllStores(this ISymbolStore store) { yield return(store); foreach (var substore in store.Substores.SelectMany(GetAllStores)) { yield return(substore); } }
void AssertEqualStores(ISymbolStore expected, ISymbolStore actual) => Assert.That(expected.DeepEquals(actual), () => { var serializerSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto, Formatting = Formatting.Indented, }; var expectedStr = JsonConvert.SerializeObject(expected, serializerSettings); var actualStr = JsonConvert.SerializeObject(actual, serializerSettings); return($"Expected: {expectedStr}\nBut was: {actualStr}"); });
public override void SetUp() { base.SetUp(); storeA = new StructuredSymbolStore(fakeFileSystem, STORE_A_PATH); storeB = new StructuredSymbolStore(fakeFileSystem, STORE_B_PATH); storeC = new StructuredSymbolStore(fakeFileSystem, STORE_C_PATH); invalidStore = new StructuredSymbolStore(fakeFileSystem, INVALID_PATH); symbolServer = new SymbolServer(); }
public override void SetUp() { base.SetUp(); storeSequence = new SymbolStoreSequence(fakeBinaryFileUtil); cacheA = new StructuredSymbolStore(fakeFileSystem, CACHE_A_PATH, isCache: true); cacheB = new StructuredSymbolStore(fakeFileSystem, CACHE_B_PATH, isCache: true); storeA = new StructuredSymbolStore(fakeFileSystem, STORE_A_PATH); storeB = new StructuredSymbolStore(fakeFileSystem, STORE_B_PATH); }
public override async Task <IFileReference> FindFileAsync(string filename, BuildId buildId, bool isDebugInfoFile, TextWriter log) { if (string.IsNullOrEmpty(filename)) { throw new ArgumentException(Strings.FilenameNullOrEmpty, "filename"); } ISymbolStore currentCache = null; foreach (var store in _stores) { IFileReference fileReference = await store.FindFileAsync(filename, buildId, false, log); if (fileReference != null) { if (!store.IsCache && currentCache != null) { try { fileReference = await currentCache.AddFileAsync(fileReference, filename, buildId, log); } catch (Exception e) when(e is NotSupportedException || e is SymbolStoreException || e is ArgumentException) { Trace.WriteLine(e.Message); await log.WriteLineAsync(e.Message); } } if (!fileReference.IsFilesystemLocation || await VerifySymbolFileAsync(fileReference.Location, buildId, isDebugInfoFile, log)) { return(fileReference); } } if (store.IsCache) { currentCache = store; } } return(null); }
public void SetUp() { searchLog = new StringWriter(); fileReference = Substitute.For <IFileReference>(); fileReference.IsFilesystemLocation.Returns(true); fileReference.Location.Returns(PATH_IN_STORE); mockSymbolStore = Substitute.For <ISymbolStore>(); mockSymbolStore.FindFileAsync(FILENAME, UUID, true, Arg.Any <TextWriter>()) .Returns(Task.FromResult(fileReference)); mockSymbolPathParser = Substitute.For <SymbolPathParser>(); mockSymbolPathParser.Parse(SEARCH_PATHS).Returns(mockSymbolStore); moduleFileFinder = new ModuleFileFinder(mockSymbolPathParser); }
public RedisQuotationProvider(ISymbolStore store, RedistQuotationProviderSetting setting) { if (store == null) { throw new ArgumentNullException(nameof(store)); } if (setting == null) { throw new ArgumentNullException(nameof(setting)); } _store = store; _setting = setting; _channels = setting.Channel; _options = new ConfigurationOptions { AllowAdmin = true, Password = setting.Password, EndPoints = { new DnsEndPoint(setting.Server, setting.Port) } }; }
public override bool DeepEquals(ISymbolStore otherStore) => otherStore is FlatSymbolStore other && _path == other._path;
public override bool DeepEquals(ISymbolStore other) { return(other is NullSymbolStore); }
public override bool DeepEquals(ISymbolStore otherStore) => otherStore is HttpSymbolStore other && _url == other._url;
public override bool DeepEquals(ISymbolStore otherStore) => otherStore is StructuredSymbolStore other && IsCache == other.IsCache &&
public QuotationStatusPublisher(QuotationContext contetContext, ISymbolStore symbolStore) { _contetContext = contetContext; _symbolStore = symbolStore; }
public GameController(IGameStore store, ISymbolStore symbolStore) { _store = store; _symbolStore = symbolStore; }
public void SetSearchPaths(string searchPaths) { _symbolStore = _symbolPathParser.Parse(searchPaths); }
public ModuleFileFinder(SymbolPathParser symbolPathParser) { _symbolPathParser = symbolPathParser; _symbolStore = new NullSymbolStore(); }
public DemoQuotationProvider(ISymbolStore stores) { _stores = stores; symbols = stores.Symbols.ToDictionary(s => s.Id, s => s); }
public abstract bool DeepEquals(ISymbolStore other);
public void AddStore(ISymbolStore store) { _stores.Add(store); }