Skip to content

Commit ba78eb4

Browse files
committed
chore: add GlobalUsings.cs with project-wide using directives in data structures tests
1 parent f1fde96 commit ba78eb4

Some content is hidden

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

43 files changed

+58
-176
lines changed

DataStructures.Tests/AATreeTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
41
using DataStructures.AATree;
5-
using FluentAssertions;
6-
using NUnit.Framework;
72

83
namespace DataStructures.Tests;
94

DataStructures.Tests/AVLTreeTests.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
41
using DataStructures.AVLTree;
5-
using FluentAssertions;
6-
using NUnit.Framework;
72
using static FluentAssertions.FluentActions;
83

94
namespace DataStructures.Tests;
@@ -233,19 +228,19 @@ public void Remove_MultipleKeys_TreeStillValid_Variant2()
233228
tree.GetKeysInOrder()
234229
.Should()
235230
.BeEquivalentTo(
236-
new[] { 4,6,8 },
231+
new[] { 4, 6, 8 },
237232
config => config.WithStrictOrdering());
238233

239234
tree.GetKeysPreOrder()
240235
.Should()
241236
.BeEquivalentTo(
242-
new[] { 6,4,8 },
237+
new[] { 6, 4, 8 },
243238
config => config.WithStrictOrdering());
244239

245240
tree.GetKeysPostOrder()
246241
.Should()
247242
.BeEquivalentTo(
248-
new[] { 4,8,6 },
243+
new[] { 4, 8, 6 },
249244
config => config.WithStrictOrdering());
250245
}
251246

DataStructures.Tests/BinarySearchTreeTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
41
using DataStructures.BinarySearchTree;
5-
using NUnit.Framework;
62

73
namespace DataStructures.Tests;
84

DataStructures.Tests/BitArrayTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System;
2-
using FluentAssertions;
3-
using NUnit.Framework;
4-
51
namespace DataStructures.Tests;
62

73
/// <summary>

DataStructures.Tests/Cache/LfuCacheTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using DataStructures.Cache;
2-
using FluentAssertions;
3-
using NUnit.Framework;
42

53
namespace DataStructures.Tests.Cache;
64

DataStructures.Tests/Cache/LruCacheTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using DataStructures.Cache;
2-
using FluentAssertions;
3-
using NUnit.Framework;
42

53
namespace DataStructures.Tests.Cache;
64

DataStructures.Tests/DisjointSet/DisjointSetTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using DataStructures.DisjointSet;
2-
using FluentAssertions;
3-
using NUnit.Framework;
42

53
namespace DataStructures.Tests.DisjointSet;
64

DataStructures.Tests/Fenwick/BinaryIndexedTreeTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using DataStructures.Fenwick;
2-
using FluentAssertions;
3-
using NUnit.Framework;
42

53
namespace DataStructures.Tests.Fenwick;
64

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// -----------------------------------------------------------------------------
2+
// Global using directives for the C-Sharp solution.
3+
// These namespaces are imported globally so they don’t need to be repeatedly declared
4+
// in individual files, improving readability and reducing boilerplate.
5+
//
6+
// Guidelines:
7+
// - Keep only the most commonly used namespaces here.
8+
// - Add project-specific namespaces (e.g., Utilities.Extensions) only if they are
9+
// required across the majority of files in the project.
10+
// - Avoid placing rarely used namespaces here to maintain clarity.
11+
// -----------------------------------------------------------------------------
12+
13+
global using System; // Core base classes and fundamental types
14+
global using System.Collections.Generic; // Generic collection types (List, Dictionary, etc.)
15+
global using System.Linq; // LINQ query operators for collections
16+
global using System.Text; // Text encoding, StringBuilder, etc.
17+
global using NUnit.Framework; // Testing framework providing attributes and assertions for test cases
18+
global using NUnit.Framework.Internal; // Internal NUnit infrastructure (test context, utilities) — generally used for advanced or framework-level test control
19+
global using FluentAssertions; // Assertion library for more readable and expressive unit tests
20+
global using System.Collections; // Non-generic collection types (e.g., ArrayList, Hashtable, IDictionary, ICollection)

DataStructures.Tests/Graph/DirectedWeightedGraphTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
41
using DataStructures.Graph;
5-
using FluentAssertions;
6-
using NUnit.Framework;
72

83
namespace DataStructures.Tests.Graph;
94

0 commit comments

Comments
 (0)