Skip to content

Commit

Permalink
Added DoubleFinishTest
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidThielen committed Oct 3, 2024
1 parent 803ed75 commit d597900
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<img align="left" width="200" src="sailboat.png"/>

# TradeWindsCommon

These are some basic classes I use throughout my code, including in some of my other NuGet projects.
These are some basic classes I use throughout my code, including in some of the other Trade Winds NuGet projects.

-----

> This is under the MIT license. If you find this very useful I ask (not a requirement) that you consider reading my book [I DON’T KNOW WHAT I’M DOING!: How a Programmer Became a Successful Startup CEO](https://a.co/d/bEpDlJR).
>
Expand Down
3 changes: 2 additions & 1 deletion TradeWindsCommon/TradeWindsCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable><Version>1.0.0.3</Version>
<Nullable>enable</Nullable>
<Version>1.0.0.4</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>Basic utility classes</Title>
<Authors>DavidThielen</Authors>
Expand Down
50 changes: 50 additions & 0 deletions UnitTests/Utilities/DoubleFinishTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

// Copyright (c) 2024 Trade Winds Studios (David Thielen)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using TradeWindsCommon.Utilities;

namespace UnitTests.Utilities
{
public class DoubleFinishTest
{
[Fact]
public void TestDoubleFinish()
{
var df = new DoubleFinish();
Assert.False(df.TryFirstFinished);
Assert.True(df.TrySecondFinished);
Assert.False(df.TryFirstFinished);
Assert.False(df.TrySecondFinished);

df = new DoubleFinish();
Assert.False(df.TrySecondFinished);
Assert.True(df.TryFirstFinished);
Assert.False(df.TrySecondFinished);
Assert.False(df.TryFirstFinished);

df = new DoubleFinish();
Assert.False(df.TryFirstFinished);
Assert.False(df.TryFirstFinished);
Assert.True(df.TrySecondFinished);
Assert.False(df.TrySecondFinished);
}
}
}

0 comments on commit d597900

Please sign in to comment.