diff --git a/README.md b/README.md index 1a4c5b5..fa8ae60 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ + + # 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). > diff --git a/TradeWindsCommon/TradeWindsCommon.csproj b/TradeWindsCommon/TradeWindsCommon.csproj index 018acf8..506ba19 100644 --- a/TradeWindsCommon/TradeWindsCommon.csproj +++ b/TradeWindsCommon/TradeWindsCommon.csproj @@ -3,7 +3,8 @@ net8.0 enable - enable1.0.0.3 + enable + 1.0.0.4 True Basic utility classes DavidThielen diff --git a/UnitTests/Utilities/DoubleFinishTest.cs b/UnitTests/Utilities/DoubleFinishTest.cs new file mode 100644 index 0000000..5612fe1 --- /dev/null +++ b/UnitTests/Utilities/DoubleFinishTest.cs @@ -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); + } + } +}