Skip to content

Commit 48159eb

Browse files
committed
Align test namespaces to avoid component class name conflicts.
- Components with classes matching the component name had an invalid namespace declared for test projects. - Previously, the test namespace would have looked like `ComponentNameExperiment.Tests`, but was changed to look like `ComponentName.Tests`. - In places where `ComponentName` is an existing class, this causes the observed error. -We were unable to use a unified namespace here due to the layout change it causes in the Visual Studio Test Explorer, breaking the existing grouping. - To fix the issue "'SomeComponent' is a namespace but is used like a type" while keeping known behavior, we simply remove the `.` in namespace declarations for `SomeComponent.Tests`.
1 parent 91af0a5 commit 48159eb

File tree

129 files changed

+132
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+132
-132
lines changed

components/Animations/tests/Animations.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<SharedGUID>39585FC1-232A-4F67-BFB8-7F6DEE296763</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>Animations.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>AnimationsTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)Test_AnimationBuilderStart.cs" />

components/Animations/tests/Test_AnimationBuilderStart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using CommunityToolkit.WinUI.Animations;
77
using System.Numerics;
88

9-
namespace Animations.Tests;
9+
namespace AnimationsTests;
1010

1111
[TestClass]
1212
[TestCategory(nameof(Test_AnimationBuilderStart))]

components/Animations/tests/Test_ExpressionFunctions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using CommunityToolkit.Tooling.TestGen;
1616
using CommunityToolkit.WinUI.Animations.Expressions;
1717

18-
namespace Animations.Tests;
18+
namespace AnimationsTests;
1919

2020
[TestClass]
2121
[TestCategory(nameof(Test_ExpressionFunctions))]

components/Behaviors/tests/Behaviors.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<SharedGUID>C5924901-9000-4A6D-936D-BD69944E8C8F</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>Behaviors.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>BehaviorsTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)StackedNotificationsBehaviorsTestPage.xaml.cs">

components/Behaviors/tests/StackedNotificationsBehaviorTestClass.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Behaviors.Tests;
5+
using BehaviorsTests;
66
using CommunityToolkit.Tests;
77
using CommunityToolkit.Tooling.TestGen;
88
using CommunityToolkit.WinUI.Behaviors;
99
using Microsoft.Xaml.Interactivity;
1010

11-
namespace StackedNotificationsBehavior.Tests;
11+
namespace StackedNotificationsBehaviorTests;
1212

1313
[TestClass]
1414
public partial class StackedNotificationsBehaviorTestClass : VisualUITestBase

components/Behaviors/tests/StackedNotificationsBehaviorsTestPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
2-
<Page x:Class="Behaviors.Tests.StackedNotificationsBehaviorsTestPage"
2+
<Page x:Class="BehaviorsTests.StackedNotificationsBehaviorsTestPage"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"

components/Behaviors/tests/StackedNotificationsBehaviorsTestPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
namespace Behaviors.Tests;
5+
namespace BehaviorsTests;
66

77
/// <summary>
88
/// An empty page that can be used on its own or navigated to within a Frame.

components/CameraPreview/tests/CameraPreview.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<SharedGUID>E4B3B38E-CB22-4C76-8906-018E2191DA41</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>CameraPreview.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>CameraPreviewTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
</Project>

components/Collections/tests/Collections.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<SharedGUID>B5DDFE59-3189-4B41-BE43-C90F53367C94</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>Collections.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>CollectionsTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)Test_AdvancedCollectionView.cs" />

components/Collections/tests/DataSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
namespace Collections.Tests;
5+
namespace CollectionsTests;
66

77
using CommunityToolkit.WinUI.Collections;
88
public class DataSource<T> : IIncrementalSource<T>

0 commit comments

Comments
 (0)