コード例 #1
0
        public void MissingFile()
        {
            var file      = Path.Combine(TestOutputDirectory, Guid.NewGuid().ToString());
            var clientKey = SymbolIndexer.TryGetSymbolClientKeyFromJsMap(file);

            Assert.Equal(null, clientKey);
        }
コード例 #2
0
        public void LockedFile()
        {
            var file = Path.Combine(TestOutputDirectory, Guid.NewGuid().ToString());

            using (var fs = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                var clientKey = SymbolIndexer.TryGetSymbolClientKeyFromJsMap(file);
                Assert.Equal(null, clientKey);
            }
        }
コード例 #3
0
        public void TryGetSymbolClientKeyFromJsMapTest(string expectedKey, string fileContents)
        {
            var file = Path.Combine(TestOutputDirectory, Guid.NewGuid().ToString());

            File.WriteAllText(file, fileContents);
            var clientKey = SymbolIndexer.TryGetSymbolClientKeyFromJsMap(file);

            Assert.Equal(expectedKey, clientKey);
            File.Delete(file);
        }
コード例 #4
0
        public async Task GetJsMapDebugEntryAsync(string fileContents, bool calculateBlobId, string expectedBlobId, string expectedClientKey)
        {
            var file = Path.Combine(TestOutputDirectory, Guid.NewGuid().ToString());

            File.WriteAllText(file, fileContents);
            var entries = await SymbolIndexer.GetJsMapDebugEntryAsync(new FileInfo(file), calculateBlobId);

            Assert.Equal(1, entries.Length);
            var entry = entries[0];

            Assert.Equal(expectedBlobId, entry.BlobIdentifier?.ToString());

            var clientKeyParts = entry.ClientKey.Split('/');

            Assert.Equal(3, clientKeyParts.Length);
            Assert.Equal(expectedClientKey, clientKeyParts[1]);
            File.Delete(file);
        }