Exemple #1
0
        public void TryGet_DoesNotExist_ReturnsFalse()
        {
            // Arrange
            var uriProvider = new DefaultFileUriProvider(Mock.Of <ITextDocumentFactoryService>());

            // Act
            var result = uriProvider.TryGet(TextBuffer, out var uri);

            // Assert
            Assert.False(result);
            Assert.Null(uri);
        }
Exemple #2
0
        public void AddOrUpdate_Adds()
        {
            // Arrange
            var expectedUri = new Uri("C:/path/to/file.razor");
            var uriProvider = new DefaultFileUriProvider(Mock.Of <ITextDocumentFactoryService>());

            // Act
            uriProvider.AddOrUpdate(TextBuffer, expectedUri);

            // Assert
            Assert.True(uriProvider.TryGet(TextBuffer, out var uri));
            Assert.Same(expectedUri, uri);
        }