Repository navigation
Expand file tree
/
Copy pathNestedDeclarations.TestGenerator.verified.cs
More file actions
193 lines (143 loc) · 8.21 KB
/
Copy pathNestedDeclarations.TestGenerator.verified.cs
File metadata and controls
193 lines (143 loc) · 8.21 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// <auto-generated/>
#nullable enable
namespace TestNamespace.Foo.Bar.Baz;
partial class MyClass
{
partial struct MyNestedStruct
{
[global::System.Diagnostics.DebuggerDisplay("{Value}")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage(Justification = "Auto-generated.")]
#region Augment Attributes
#endregion Augment Attributes
readonly partial struct TestValueObject :
#region Base Interfaces
global::TransparentValueObjects.IValueObject<global::System.String>,
global::System.IEquatable<TestValueObject>,
global::System.IEquatable<global::System.String>
#endregion Base Interfaces
#region Forwarded Interfaces
,global::System.IComparable<TestValueObject>
,global::System.IComparable<global::System.String>
#endregion Forwarded Interfaces
#region Augment Interfaces
#endregion Augment Interfaces
{
/// <summary>
/// The underlying data of the value object.
/// </summary>
public readonly global::System.String Value;
/// <inheritdoc/>
public static global::System.Type InnerValueType => typeof(global::System.String);
/// <summary>
/// Creates a new instance of the value object using the provided inner value.
/// </summary>
/// <param name="value">The value that the value object should wrap.</param>
/// <returns>A new instance of this value object.</returns>
public static TestValueObject From(global::System.String value) => new(value);
#region Constructors
private TestValueObject(global::System.String value)
{
Value = value;
}
/// <summary>
/// The default constructor is disabled and will throw an exception if called.
/// </summary>
/// <remarks>
/// The default constructor can be enabled by providing a default value
/// using the <see cref="global::TransparentValueObjects.DefaultValueAugment"/> augment.
/// </remarks>
/// <exception cref="global::System.InvalidOperationException">Thrown when called.</exception>
[global::System.Obsolete($"Use TestValueObject.{nameof(From)} instead.", error: true)]
public TestValueObject()
{
throw new global::System.InvalidOperationException($"Use TestValueObject.{nameof(From)} instead.");
}
#endregion Constructors
#region Base Methods
/// <inheritdoc/>
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public override global::System.Int32 GetHashCode() => Value.GetHashCode();
/// <inheritdoc/>
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public override global::System.String ToString() => Value.ToString();
#endregion Base Methods
#region Equals Methods
/// <inheritdoc/>
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public global::System.Boolean Equals(TestValueObject other) => Equals(other.Value);
/// <inheritdoc/>
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public global::System.Boolean Equals(global::System.String? other) => Value.Equals(other);
/// <summary>
/// Determines whether the specified value is equal to the current inner value using a custom equality comparer.
/// </summary>
/// <param name="other">The value to compare with the current inner value.</param>
/// <param name="comparer">The comparer to use.</param>
/// <returns></returns>
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public global::System.Boolean Equals(global::System.String other, global::System.Collections.Generic.IEqualityComparer<global::System.String> comparer) => comparer.Equals(Value, other);
/// <inheritdoc/>
[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public override global::System.Boolean Equals(global::System.Object? obj)
{
if (obj is null) return false;
if (obj is TestValueObject value) return Equals(value);
if (obj is global::System.String innerValue) return Equals(innerValue);
return false;
}
#endregion Equals Methods
#region Equality Operators
/// <summary>Equality Operator</summary>
public static global::System.Boolean operator ==(TestValueObject left, TestValueObject right) => left.Equals(right);
/// <summary>Equality Operator</summary>
public static global::System.Boolean operator !=(TestValueObject left, TestValueObject right) => !left.Equals(right);
/// <summary>Equality Operator</summary>
public static global::System.Boolean operator ==(TestValueObject left, global::System.String right) => left.Equals(right);
/// <summary>Equality Operator</summary>
public static global::System.Boolean operator !=(TestValueObject left, global::System.String right) => !left.Equals(right);
/// <summary>Equality Operator</summary>
public static global::System.Boolean operator ==(global::System.String left, TestValueObject right) => right.Equals(left);
/// <summary>Equality Operator</summary>
public static global::System.Boolean operator !=(global::System.String left, TestValueObject right) => !right.Equals(left);
#endregion Equality Operators
#region Explicit Cast Operators
/// <summary>Explicit Casting Operator</summary>
public static explicit operator TestValueObject(global::System.String value) => From(value);
/// <summary>Explicit Casting Operator</summary>
public static explicit operator global::System.String(TestValueObject value) => value.Value;
#endregion Explicit Cast Operators
#region IComparable Implementation
/// <inheritdoc/>
public global::System.Int32 CompareTo(TestValueObject other) => Value.CompareTo(other.Value);
/// <inheritdoc/>
public global::System.Int32 CompareTo(global::System.String? other) => Value.CompareTo(other);
#endregion IComparable Implementation
#region Comparison Operators
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator <(TestValueObject left, TestValueObject right) => left.Value.CompareTo(right.Value) < 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator >(TestValueObject left, TestValueObject right) => left.Value.CompareTo(right.Value) > 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator <=(TestValueObject left, TestValueObject right) => left.Value.CompareTo(right.Value) <= 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator >=(TestValueObject left, TestValueObject right) => left.Value.CompareTo(right.Value) >= 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator <(global::System.String left, TestValueObject right) => left.CompareTo(right.Value) < 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator >(global::System.String left, TestValueObject right) => left.CompareTo(right.Value) > 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator <=(global::System.String left, TestValueObject right) => left.CompareTo(right.Value) <= 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator >=(global::System.String left, TestValueObject right) => left.CompareTo(right.Value) >= 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator <(TestValueObject left, global::System.String right) => left.Value.CompareTo(right) < 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator >(TestValueObject left, global::System.String right) => left.Value.CompareTo(right) > 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator <=(TestValueObject left, global::System.String right) => left.Value.CompareTo(right) <= 0;
/// <summary>Comparison Operator</summary>
public static global::System.Boolean operator >=(TestValueObject left, global::System.String right) => left.Value.CompareTo(right) >= 0;
#endregion Comparison Operators
}
}
}