Skip to content

Commit 072a767

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 simple remove the `.` in namespace declarations for `SomeComponent.Tests`.
1 parent 5f9441d commit 072a767

File tree

57 files changed

+58
-58
lines changed

Some content is hidden

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

57 files changed

+58
-58
lines changed

components/AppServices/tests/AppServices.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
<SharedGUID>A3106AE5-5AA9-4307-9041-E9C4232AA7F2</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>AppServices.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>AppServicesTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
</Project>

components/CanvasLayout/tests/CanvasLayout.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<SharedGUID>A09DC4AC-4111-440E-A188-E787CAE8C0B1</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>CanvasLayout.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>CanvasLayoutTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)ExampleCanvasLayoutTestClass.cs" />

components/CanvasLayout/tests/ExampleCanvasLayoutTestClass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using CommunityToolkit.Tooling.TestGen;
77
using CommunityToolkit.Tests;
88

9-
namespace CanvasLayout.Tests;
9+
namespace CanvasLayoutTests;
1010

1111
[TestClass]
1212
public partial class ExampleCanvasLayoutTestClass : VisualUITestBase

components/CanvasLayout/tests/ExampleCanvasLayoutTestPage.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="CanvasLayout.Tests.ExampleCanvasLayoutTestPage"
2+
<Page x:Class="CanvasLayoutTests.ExampleCanvasLayoutTestPage"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

components/CanvasLayout/tests/ExampleCanvasLayoutTestPage.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 CanvasLayout.Tests;
5+
namespace CanvasLayoutTests;
66

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

components/CanvasView/tests/CanvasView.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<SharedGUID>33D731BA-A745-418B-BF4A-BD8FB9880918</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>CanvasView.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>CanvasViewTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)ExampleCanvasViewTestClass.cs" />

components/CanvasView/tests/ExampleCanvasViewTestClass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using CommunityToolkit.Tooling.TestGen;
77
using CommunityToolkit.Tests;
88

9-
namespace CanvasView.Tests;
9+
namespace CanvasViewTests;
1010

1111
[TestClass]
1212
public partial class ExampleCanvasViewTestClass : VisualUITestBase

components/CanvasView/tests/ExampleCanvasViewTestPage.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="CanvasView.Tests.ExampleCanvasViewTestPage"
2+
<Page x:Class="CanvasViewTests.ExampleCanvasViewTestPage"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

components/CanvasView/tests/ExampleCanvasViewTestPage.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 CanvasView.Tests;
5+
namespace CanvasViewTests;
66

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

components/DataTable/tests/DataTable.Tests.projitems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<SharedGUID>758CD4BC-2E2C-4FAD-8C96-BD73E0EF128B</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
9-
<Import_RootNamespace>DataTable.Tests</Import_RootNamespace>
9+
<Import_RootNamespace>DataTableTests</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)DataTableLayoutTestClass.cs" />

0 commit comments

Comments
 (0)