Skip to content

Commit e0c5a95

Browse files
committed
Add tests project
1 parent 5dafff6 commit e0c5a95

32 files changed

+225
-235
lines changed

AttributeGenerator/Program.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Program
1616
const BindingFlags BINDING_FLAGS = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly;
1717
const string SAVE_PATH = "../../../Chance.NET/Attributes/Generated/";
1818

19-
static string[] EXCLUDE = new string[] { "Color" };
19+
static string[] EXCLUDE = new string[] { "Color", "Date" };
2020

2121
static void Main(string[] args)
2222
{
@@ -148,7 +148,7 @@ static string Generate(string template, List<MethodInfo> methods)
148148
}
149149
else if (paramType.IsEnum)
150150
{
151-
defaultValue = string.Format("({0})0xFF", paramType.Name);
151+
defaultValue = string.Format("({0})~0", paramType.Name);
152152
}
153153

154154
parameters.AppendFormat("{0} {1} = {2}", paramTypeName, param.Name, defaultValue);
@@ -190,7 +190,7 @@ static object GetDefaultValue(List<MethodInfo> methods, ParameterInfo param)
190190
}
191191
else if (paramType.IsEnum)
192192
{
193-
defaultValue = string.Format("({0})0xFF", paramType.Name);
193+
defaultValue = string.Format("({0})~0", paramType.Name);
194194
}
195195

196196
if (isNullable)
+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" />
4+
<Import Project="..\packages\NUnit.3.10.1\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.10.1\build\NUnit.props')" />
5+
<Import Project="..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props')" />
6+
<PropertyGroup>
7+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9+
<ProjectGuid>{CE4EB6B1-F432-488A-854D-84201EB0D3B3}</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>ChanceNET.Tests</RootNamespace>
13+
<AssemblyName>ChanceNET.Tests</AssemblyName>
14+
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
15+
<FileAlignment>512</FileAlignment>
16+
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
17+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
18+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
19+
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
20+
<IsCodedUITest>False</IsCodedUITest>
21+
<TestProjectType>UnitTest</TestProjectType>
22+
<NuGetPackageImportStamp>
23+
</NuGetPackageImportStamp>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
26+
<DebugSymbols>true</DebugSymbols>
27+
<DebugType>full</DebugType>
28+
<Optimize>false</Optimize>
29+
<OutputPath>bin\Debug\</OutputPath>
30+
<DefineConstants>DEBUG;TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
35+
<DebugType>pdbonly</DebugType>
36+
<Optimize>true</Optimize>
37+
<OutputPath>bin\Release\</OutputPath>
38+
<DefineConstants>TRACE</DefineConstants>
39+
<ErrorReport>prompt</ErrorReport>
40+
<WarningLevel>4</WarningLevel>
41+
</PropertyGroup>
42+
<ItemGroup>
43+
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
44+
<HintPath>..\packages\MSTest.TestFramework.1.2.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
47+
<HintPath>..\packages\MSTest.TestFramework.1.2.1\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
48+
</Reference>
49+
<Reference Include="nunit.framework, Version=3.10.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
50+
<HintPath>..\packages\NUnit.3.10.1\lib\net45\nunit.framework.dll</HintPath>
51+
</Reference>
52+
<Reference Include="System" />
53+
<Reference Include="System.Core" />
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="Models\Book.cs" />
57+
<Compile Include="Properties\AssemblyInfo.cs" />
58+
<Compile Include="SerializationTests.cs" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<None Include="packages.config" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<ProjectReference Include="..\Chance.NET\Chance.NET.csproj">
65+
<Project>{d2a12520-1f77-4119-b1fd-7fd1cb52bd8c}</Project>
66+
<Name>Chance.NET</Name>
67+
</ProjectReference>
68+
</ItemGroup>
69+
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
70+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
71+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
72+
<PropertyGroup>
73+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
74+
</PropertyGroup>
75+
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.props'))" />
76+
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets'))" />
77+
<Error Condition="!Exists('..\packages\NUnit.3.10.1\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.10.1\build\NUnit.props'))" />
78+
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.10.0\build\net35\NUnit3TestAdapter.props'))" />
79+
</Target>
80+
<Import Project="..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.1\build\net45\MSTest.TestAdapter.targets')" />
81+
</Project>

Chance.NET.Tests/Models/Book.cs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
using ChanceNET.Attributes;
8+
9+
namespace ChanceNET.Tests
10+
{
11+
public class Book
12+
{
13+
[Year]
14+
public int Year;
15+
16+
[Sentence]
17+
public string Title;
18+
19+
[Date]
20+
public DateTime Release;
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("Chance.NET.Tests")]
6+
[assembly: AssemblyDescription("")]
7+
[assembly: AssemblyConfiguration("")]
8+
[assembly: AssemblyCompany("")]
9+
[assembly: AssemblyProduct("Chance.NET.Tests")]
10+
[assembly: AssemblyCopyright("Copyright © 2018")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
14+
[assembly: ComVisible(false)]
15+
16+
[assembly: Guid("ce4eb6b1-f432-488a-854d-84201eb0d3b3")]
17+
18+
// [assembly: AssemblyVersion("1.0.*")]
19+
[assembly: AssemblyVersion("1.0.0.0")]
20+
[assembly: AssemblyFileVersion("1.0.0.0")]
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Text;
3+
using System.Collections.Generic;
4+
5+
using NUnit.Framework;
6+
7+
namespace ChanceNET.Tests
8+
{
9+
/// <summary>
10+
/// Summary description for SerializationTests
11+
/// </summary>
12+
[TestFixture]
13+
public class SerializationTests
14+
{
15+
Chance chance = new Chance();
16+
17+
[Test]
18+
public void Test1()
19+
{
20+
Book b = chance.Object<Book>();
21+
22+
Assert.IsTrue(b.Year > 0);
23+
Assert.IsTrue(b.Release != default(DateTime));
24+
Assert.IsFalse(string.IsNullOrWhiteSpace(b.Title));
25+
}
26+
27+
[TearDown]
28+
public void Reset()
29+
{
30+
chance = chance.New();
31+
}
32+
}
33+
}

Chance.NET.Tests/packages.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="MSTest.TestAdapter" version="1.2.1" targetFramework="net471" />
4+
<package id="MSTest.TestFramework" version="1.2.1" targetFramework="net471" />
5+
<package id="NUnit" version="3.10.1" targetFramework="net471" />
6+
<package id="NUnit3TestAdapter" version="3.10.0" targetFramework="net471" />
7+
</packages>

Chance.NET.sln

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.27130.2024
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{26FB48DF-3C65-447C-A382-26FEF18E996A}"
7-
EndProject
86
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AttributeGenerator", "AttributeGenerator\AttributeGenerator.csproj", "{B053EC2E-1326-451D-942F-2DE532A498F2}"
97
EndProject
108
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{14AC7A99-0B93-47C5-B070-D66B28225E7B}"
@@ -13,22 +11,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1311
README.md = README.md
1412
EndProjectSection
1513
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chance.NET", "Chance.NET\Chance.NET.csproj", "{D2A12520-1F77-4119-B1FD-7FD1CB52BD8C}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Chance.NET", "Chance.NET\Chance.NET.csproj", "{D2A12520-1F77-4119-B1FD-7FD1CB52BD8C}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chance.NET.Tests", "Chance.NET.Tests\Chance.NET.Tests.csproj", "{CE4EB6B1-F432-488A-854D-84201EB0D3B3}"
1717
EndProject
1818
Global
1919
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2020
Debug|Any CPU = Debug|Any CPU
2121
Release|Any CPU = Release|Any CPU
2222
EndGlobalSection
2323
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24-
{2FD8BCDD-9C08-4DD4-A883-61DDF5E5D2E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25-
{2FD8BCDD-9C08-4DD4-A883-61DDF5E5D2E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
26-
{2FD8BCDD-9C08-4DD4-A883-61DDF5E5D2E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
27-
{2FD8BCDD-9C08-4DD4-A883-61DDF5E5D2E8}.Release|Any CPU.Build.0 = Release|Any CPU
28-
{26FB48DF-3C65-447C-A382-26FEF18E996A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29-
{26FB48DF-3C65-447C-A382-26FEF18E996A}.Debug|Any CPU.Build.0 = Debug|Any CPU
30-
{26FB48DF-3C65-447C-A382-26FEF18E996A}.Release|Any CPU.ActiveCfg = Release|Any CPU
31-
{26FB48DF-3C65-447C-A382-26FEF18E996A}.Release|Any CPU.Build.0 = Release|Any CPU
3224
{B053EC2E-1326-451D-942F-2DE532A498F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3325
{B053EC2E-1326-451D-942F-2DE532A498F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
3426
{B053EC2E-1326-451D-942F-2DE532A498F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -37,6 +29,10 @@ Global
3729
{D2A12520-1F77-4119-B1FD-7FD1CB52BD8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
3830
{D2A12520-1F77-4119-B1FD-7FD1CB52BD8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
3931
{D2A12520-1F77-4119-B1FD-7FD1CB52BD8C}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{CE4EB6B1-F432-488A-854D-84201EB0D3B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{CE4EB6B1-F432-488A-854D-84201EB0D3B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{CE4EB6B1-F432-488A-854D-84201EB0D3B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{CE4EB6B1-F432-488A-854D-84201EB0D3B3}.Release|Any CPU.Build.0 = Release|Any CPU
4036
EndGlobalSection
4137
GlobalSection(SolutionProperties) = preSolution
4238
HideSolutionNode = FALSE

Chance.NET/Attributes/Generated/DateAttribute.Generated.cs renamed to Chance.NET/Attributes/DateAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ namespace ChanceNET.Attributes
1111
public class DateAttribute : ChanceAttribute
1212
{
1313
Int32 year = 0;
14-
Month month = (Month)0xFF;
14+
Month month = (Month)0;
1515
Int32 day = 0;
1616
Int32 minYear = 1970;
1717
Int32 maxYear = 9999;
1818

1919

20-
public DateAttribute(Int32 year = 0, Month month = (Month)0xFF, Int32 day = 0, Int32 minYear = 1970, Int32 maxYear = 9999)
20+
public DateAttribute(Int32 year = 0, Month month = (Month)0, Int32 day = 0, Int32 minYear = 1970, Int32 maxYear = 9999)
2121
{
2222
this.year = year;
2323
this.month = month;

Chance.NET/Attributes/Generated/AgeAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class AgeAttribute : ChanceAttribute
1212
{
13-
AgeRanges range = (AgeRanges)0xFF;
13+
AgeRanges range = (AgeRanges)~0;
1414

1515

16-
public AgeAttribute(AgeRanges range = (AgeRanges)0xFF)
16+
public AgeAttribute(AgeRanges range = (AgeRanges)~0)
1717
{
1818
this.range = range;
1919

Chance.NET/Attributes/Generated/AnimalAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class AnimalAttribute : ChanceAttribute
1212
{
13-
AnimalTypes type = (AnimalTypes)0xFF;
13+
AnimalTypes type = (AnimalTypes)~0;
1414

1515

16-
public AnimalAttribute(AnimalTypes type = (AnimalTypes)0xFF)
16+
public AnimalAttribute(AnimalTypes type = (AnimalTypes)~0)
1717
{
1818
this.type = type;
1919

Chance.NET/Attributes/Generated/AvatarAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class AvatarAttribute : ChanceAttribute
1212
{
13-
GravatarDefaults defaultType = (GravatarDefaults)0xFF;
13+
GravatarDefaults defaultType = (GravatarDefaults)~0;
1414

1515

16-
public AvatarAttribute(GravatarDefaults defaultType = (GravatarDefaults)0xFF)
16+
public AvatarAttribute(GravatarDefaults defaultType = (GravatarDefaults)~0)
1717
{
1818
this.defaultType = defaultType;
1919

Chance.NET/Attributes/Generated/BirthdayAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class BirthdayAttribute : ChanceAttribute
1212
{
13-
AgeRanges range = (AgeRanges)0xFF;
13+
AgeRanges range = (AgeRanges)~0;
1414

1515

16-
public BirthdayAttribute(AgeRanges range = (AgeRanges)0xFF)
16+
public BirthdayAttribute(AgeRanges range = (AgeRanges)~0)
1717
{
1818
this.range = range;
1919

Chance.NET/Attributes/Generated/CreditCardAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class CreditCardAttribute : ChanceAttribute
1212
{
13-
CreditCardTypes types = (CreditCardTypes)0xFF;
13+
CreditCardTypes types = (CreditCardTypes)~0;
1414

1515

16-
public CreditCardAttribute(CreditCardTypes types = (CreditCardTypes)0xFF)
16+
public CreditCardAttribute(CreditCardTypes types = (CreditCardTypes)~0)
1717
{
1818
this.types = types;
1919

Chance.NET/Attributes/Generated/CreditCardNumberAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class CreditCardNumberAttribute : ChanceAttribute
1212
{
13-
CreditCardTypes types = (CreditCardTypes)0xFF;
13+
CreditCardTypes types = (CreditCardTypes)~0;
1414

1515

16-
public CreditCardNumberAttribute(CreditCardTypes types = (CreditCardTypes)0xFF)
16+
public CreditCardNumberAttribute(CreditCardTypes types = (CreditCardTypes)~0)
1717
{
1818
this.types = types;
1919

Chance.NET/Attributes/Generated/CreditCardTypeAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class CreditCardTypeAttribute : ChanceAttribute
1212
{
13-
CreditCardTypes types = (CreditCardTypes)0xFF;
13+
CreditCardTypes types = (CreditCardTypes)~0;
1414

1515

16-
public CreditCardTypeAttribute(CreditCardTypes types = (CreditCardTypes)0xFF)
16+
public CreditCardTypeAttribute(CreditCardTypes types = (CreditCardTypes)~0)
1717
{
1818
this.types = types;
1919

Chance.NET/Attributes/Generated/FileExtensionAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class FileExtensionAttribute : ChanceAttribute
1212
{
13-
FileExtensionTypes types = (FileExtensionTypes)0xFF;
13+
FileExtensionTypes types = (FileExtensionTypes)~0;
1414

1515

16-
public FileExtensionAttribute(FileExtensionTypes types = (FileExtensionTypes)0xFF)
16+
public FileExtensionAttribute(FileExtensionTypes types = (FileExtensionTypes)~0)
1717
{
1818
this.types = types;
1919

Chance.NET/Attributes/Generated/FirstNameAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class FirstNameAttribute : ChanceAttribute
1212
{
13-
Gender gender = (Gender)0xFF;
13+
Gender gender = (Gender)~0;
1414

1515

16-
public FirstNameAttribute(Gender gender = (Gender)0xFF)
16+
public FirstNameAttribute(Gender gender = (Gender)~0)
1717
{
1818
this.gender = gender;
1919

Chance.NET/Attributes/Generated/FullNameAttribute.Generated.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ namespace ChanceNET.Attributes
1010
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
1111
public class FullNameAttribute : ChanceAttribute
1212
{
13-
Gender gender = (Gender)0xFF;
13+
Gender gender = (Gender)~0;
1414
Boolean prefix = false;
1515
Boolean middle = false;
1616
Boolean middleInitial = false;
1717
Boolean suffix = false;
1818

1919

20-
public FullNameAttribute(Gender gender = (Gender)0xFF, Boolean prefix = false, Boolean middle = false, Boolean middleInitial = false, Boolean suffix = false)
20+
public FullNameAttribute(Gender gender = (Gender)~0, Boolean prefix = false, Boolean middle = false, Boolean middleInitial = false, Boolean suffix = false)
2121
{
2222
this.gender = gender;
2323
this.prefix = prefix;

0 commit comments

Comments
 (0)