Esempio n. 1
0
        public async Task Handle_SearchFound()
        {
            // Arrange
            var tagHelperDescriptor1 = CreateRazorComponentTagHelperDescriptor("First", "First.Components", "Component1");
            var tagHelperDescriptor2 = CreateRazorComponentTagHelperDescriptor("Second", "Second.Components", "Component3");
            var searchEngine         = new DefaultRazorComponentSearchEngine(Dispatcher, _projectSnapshotManager);

            // Act
            var documentSnapshot1 = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor1).ConfigureAwait(false);

            var documentSnapshot2 = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor2).ConfigureAwait(false);

            // Assert
            Assert.NotNull(documentSnapshot1);
            Assert.NotNull(documentSnapshot2);
        }
Esempio n. 2
0
        public async Task Handle_SearchFound_GenericComponent()
        {
            // Arrange
            var tagHelperDescriptor1 = CreateRazorComponentTagHelperDescriptor("First", "First.Components", "Component1", typeName: "Component1<TItem>");
            var tagHelperDescriptor2 = CreateRazorComponentTagHelperDescriptor("Second", "Second.Components", "Component3", typeName: "Component3<TItem>");
            var searchEngine         = new DefaultRazorComponentSearchEngine(LegacyDispatcher, s_projectSnapshotManager, LoggerFactory);

            // Act
            var documentSnapshot1 = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor1).ConfigureAwait(false);

            var documentSnapshot2 = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor2).ConfigureAwait(false);

            // Assert
            Assert.NotNull(documentSnapshot1);
            Assert.NotNull(documentSnapshot2);
        }
Esempio n. 3
0
        public async Task Handle_SearchMissing_IncorrectComponent()
        {
            // Arrange
            var tagHelperDescriptor = CreateRazorComponentTagHelperDescriptor("First", "First.Components", "Component3");
            var searchEngine        = new DefaultRazorComponentSearchEngine(Dispatcher, _projectSnapshotManager);

            // Act
            var documentSnapshot = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor).ConfigureAwait(false);

            // Assert
            Assert.Null(documentSnapshot);
        }
Esempio n. 4
0
        public async Task Handle_SearchFound_SetNamespace()
        {
            // Arrange
            var tagHelperDescriptor = CreateRazorComponentTagHelperDescriptor("First", "Test", "Component2");
            var searchEngine        = new DefaultRazorComponentSearchEngine(Dispatcher, _projectSnapshotManager);

            // Act
            var documentSnapshot = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor).ConfigureAwait(false);

            // Assert
            Assert.NotNull(documentSnapshot);
        }
Esempio n. 5
0
        public async Task Handle_FilePathAndAssemblyNameDifferent()
        {
            // Arrange
            var tagHelperDescriptor = CreateRazorComponentTagHelperDescriptor("AssemblyName", "Test", "Component2");
            var searchEngine        = new DefaultRazorComponentSearchEngine(LegacyDispatcher, s_projectSnapshotManager, LoggerFactory);

            // Act
            var documentSnapshot = await searchEngine.TryLocateComponentAsync(tagHelperDescriptor).ConfigureAwait(false);

            // Assert
            Assert.NotNull(documentSnapshot);
        }
Esempio n. 6
0
        public async void Handle_SearchFound()
        {
            // Arrange
            var tagHelperDescriptor1 = CreateRazorComponentTagHelperDescriptor("First", "First.Components", "Component1");
            var tagHelperDescriptor2 = CreateRazorComponentTagHelperDescriptor("Second", "Second.Components", "Component3");

            // Act
            var documentSnapshot1 = await _searchEngine.TryLocateComponentAsync(tagHelperDescriptor1).ConfigureAwait(false);

            var documentSnapshot2 = await _searchEngine.TryLocateComponentAsync(tagHelperDescriptor2).ConfigureAwait(false);

            // Assert
            Assert.NotNull(documentSnapshot1);
            Assert.NotNull(documentSnapshot2);
        }