-
Notifications
You must be signed in to change notification settings - Fork 479
Expand file tree
/
Copy pathReflectionExtensions.cs
More file actions
50 lines (43 loc) · 1.59 KB
/
ReflectionExtensions.cs
File metadata and controls
50 lines (43 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using Xunit;
using FluentAssertions;
using CommandLine.Core;
using CommandLine.Tests.Fakes;
namespace CommandLine.Tests.Unit.Core
{
public class ReflectionHelperTests
{
[Fact]
public static void Class_with_public_set_properties_or_fields_is_ranked_mutable()
{
typeof(Simple_Options).IsMutable().Should().BeTrue();
}
[Fact]
public static void Class_without_public_set_properties_or_fields_is_ranked_immutable()
{
typeof(Immutable_Simple_Options).IsMutable().Should().BeFalse();
}
[Fact]
public static void Class_with_read_only_properties_is_ranked_immutable()
{
typeof(Immutable_Simple_Options_Read_Only).IsMutable().Should().BeFalse();
}
[Fact]
public static void Class_with_private_set_properties_is_ranked_immutable()
{
typeof(Immutable_Simple_Options_Private_Set).IsMutable().Should().BeFalse();
}
#if NET5_0_OR_GREATER
[Fact]
public static void Class_with_init_properties_is_ranked_immutable()
{
typeof(Immutable_Simple_Options_Init).IsMutable().Should().BeFalse();
}
[Fact]
public static void Record_without_public_set_properties_or_fields_is_ranked_immutable()
{
typeof(Immutable_Simple_Options_Record).IsMutable().Should().BeFalse();
}
#endif
}
}