diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index cc3f773ce2..3d2825984a 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -14,7 +14,7 @@ jobs: version: ${{ steps.release_info.outputs.version }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Generate Release Info @@ -39,7 +39,7 @@ jobs: #Prepend patch notes with backticks sed -i '1s/^/```\n/' patch_notes.txt - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: release_info path: | @@ -56,9 +56,9 @@ jobs: OUTPUT_FILE_NAME: DOLServer_${{ matrix.build_target }}.zip steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Dotnet - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' - name: Setup MinGW-w64 @@ -87,8 +87,8 @@ jobs: cp libdol_detour.dll ../../../${{ matrix.build_target }}/dol_detour.dll - name: Test Build run: | - dotnet test --verbosity normal --filter "DOL.UnitTests&TestCategory!=Explicit" ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll - dotnet test --verbosity normal --filter "DOL.Integration&TestCategory!=Explicit" ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll + dotnet test --verbosity normal --filter "DOL.UnitTests" ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll + dotnet test --verbosity normal --filter "DOL.Integration" ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll - name: Add DOLConfig if: ${{ github.repository_owner == 'Dawn-of-Light' }} run: | @@ -112,7 +112,7 @@ jobs: run: | (cd ${{ matrix.build_target }}/ && zip -r ../${{ env.OUTPUT_FILE_NAME }} * ) - name: Upload Build Output - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build_artifacts path: ${{ env.OUTPUT_FILE_NAME }} @@ -123,9 +123,9 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Create Release run: | set -x diff --git a/.github/workflows/docker_build_push.yml b/.github/workflows/docker_build_push.yml index 501d13c3f3..99f8a6d83b 100644 --- a/.github/workflows/docker_build_push.yml +++ b/.github/workflows/docker_build_push.yml @@ -20,18 +20,18 @@ jobs: run: | echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU for Docker - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: .github/Docker target: release_dotnet @@ -44,7 +44,7 @@ jobs: push: true tags: dawnoflight/dolsharp:latest - name: Build and push Sandbox - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: .github/Docker target: release_sandbox_dotnet diff --git a/.github/workflows/test_netcore_linux.yml b/.github/workflows/test_netcore_linux.yml index 74be19a9fa..ca1370a7f9 100644 --- a/.github/workflows/test_netcore_linux.yml +++ b/.github/workflows/test_netcore_linux.yml @@ -13,15 +13,15 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Dotnet - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Build run: | dotnet build -c ${{ matrix.build_target }} "Tests/Tests.csproj" --verbosity normal - name: Test run: | - dotnet test ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll -v n --filter "DOL.UnitTests&TestCategory!=Explicit" - dotnet test ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll -v n --filter "DOL.Integration&TestCategory!=Explicit" + dotnet test ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll -v n --filter "DOL.UnitTests" + dotnet test ./build/Tests/${{ matrix.build_target }}/lib/Tests.dll -v n --filter "DOL.Integration" diff --git a/.github/workflows/test_netcore_windows.yml b/.github/workflows/test_netcore_windows.yml index f042b6c629..3620cc6a61 100644 --- a/.github/workflows/test_netcore_windows.yml +++ b/.github/workflows/test_netcore_windows.yml @@ -13,15 +13,15 @@ jobs: runs-on: windows-2019 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Dotnet - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Build run: | dotnet build -c ${{ matrix.build_target }} "Tests\Tests.csproj" --verbosity normal - name: Test run: | - dotnet test .\build\Tests\${{ matrix.build_target }}\lib\Tests.dll -v n --filter "DOL.UnitTests&TestCategory!=Explicit" - dotnet test .\build\Tests\${{ matrix.build_target }}\lib\Tests.dll -v n --filter "DOL.Integration&TestCategory!=Explicit" + dotnet test .\build\Tests\${{ matrix.build_target }}\lib\Tests.dll -v n --filter "DOL.UnitTests" + dotnet test .\build\Tests\${{ matrix.build_target }}\lib\Tests.dll -v n --filter "DOL.Integration" diff --git a/DOLBase/DOLBase.csproj b/DOLBase/DOLBase.csproj index 8f73acbe92..6d386c1930 100644 --- a/DOLBase/DOLBase.csproj +++ b/DOLBase/DOLBase.csproj @@ -38,7 +38,7 @@ - + diff --git a/DOLDatabase/DOLDatabase.csproj b/DOLDatabase/DOLDatabase.csproj index 270c55cb5a..2331269365 100644 --- a/DOLDatabase/DOLDatabase.csproj +++ b/DOLDatabase/DOLDatabase.csproj @@ -39,8 +39,8 @@ - - + + diff --git a/DOLServer/DOLServer.csproj b/DOLServer/DOLServer.csproj index 2fb4475e5e..92176312d3 100644 --- a/DOLServer/DOLServer.csproj +++ b/DOLServer/DOLServer.csproj @@ -4,7 +4,7 @@ - net6.0 + net8.0 Exe Debug AnyCPU @@ -45,7 +45,7 @@ False - + diff --git a/GameServer/GameServer.csproj b/GameServer/GameServer.csproj index 4c2a55a2a2..91ccb7ab5b 100644 --- a/GameServer/GameServer.csproj +++ b/GameServer/GameServer.csproj @@ -4,7 +4,7 @@ - net6.0 + net8.0 Debug AnyCPU GameServer @@ -38,9 +38,9 @@ - - - + + + diff --git a/GameServer/gameutils/DOLScriptCompiler.cs b/GameServer/gameutils/DOLScriptCompiler.cs index cf013a729a..2e0c9cf308 100644 --- a/GameServer/gameutils/DOLScriptCompiler.cs +++ b/GameServer/gameutils/DOLScriptCompiler.cs @@ -135,8 +135,7 @@ private static void LoadDefaultAssemblies() .Where(s => !string.IsNullOrEmpty(s)) .Select(s => MetadataReference.CreateFromFile(s)); var additionalReferences = new string[] { - "System.Security.Cryptography.Algorithms", //for SHA256 in AutoXMLDatabaseUpdate - "System.Security.Cryptography.Primitives", //for SHA256 in AutoXMLDatabaseUpdate + "System.Security.Cryptography", //for SHA256 in AutoXMLDatabaseUpdate "System.Net.Http" }.Union(GameServer.Instance.Configuration.AdditionalScriptAssemblies) .Select(r => GetPortableExecutableReference(r)); diff --git a/GameServerScripts/GameServerScripts.csproj b/GameServerScripts/GameServerScripts.csproj index e9de8a90c6..b614a408bd 100644 --- a/GameServerScripts/GameServerScripts.csproj +++ b/GameServerScripts/GameServerScripts.csproj @@ -4,7 +4,7 @@ - net6.0 + net8.0 Debug AnyCPU Library diff --git a/GameServerScripts/dbupdater/LanguageSystemUpdate.cs b/GameServerScripts/dbupdater/LanguageSystemUpdate.cs index 7259393e49..cd93eac64e 100644 --- a/GameServerScripts/dbupdater/LanguageSystemUpdate.cs +++ b/GameServerScripts/dbupdater/LanguageSystemUpdate.cs @@ -29,7 +29,7 @@ namespace DOL.GS.DatabaseUpdate public class LanguageSystemUpdate : IDatabaseUpdater { #region DBLanguage table structure - private class language : DataObject + private class Language : DataObject { protected string m_translationid; protected string m_EN = ""; @@ -39,7 +39,7 @@ private class language : DataObject protected string m_CU = ""; protected string m_packageID; - public language() { } + public Language() { } [DataElement(AllowDbNull = false, Unique = true)] public string TranslationID @@ -103,12 +103,12 @@ public void Update() if (GameServer.Database.GetObjectCount() < 1 && ServerProperties.Properties.USE_DBLANGUAGE) { - var objs = GameServer.Database.SelectAllObjects(); + var objs = GameServer.Database.SelectAllObjects(); if (objs.Count > 0) { List lngObjs = new List(); - foreach (language obj in objs) + foreach (Language obj in objs) { if (Util.IsEmpty(obj.TranslationID)) continue; diff --git a/GameServerScripts/quests/Albion/ChildsPlay.cs b/GameServerScripts/quests/Albion/ChildsPlay.cs index f66adadb6b..7f377c464a 100644 --- a/GameServerScripts/quests/Albion/ChildsPlay.cs +++ b/GameServerScripts/quests/Albion/ChildsPlay.cs @@ -46,7 +46,7 @@ namespace DOL.GS.Quests.Albion { - public class childsplay : BaseQuest + public class ChildsPlay : BaseQuest { /// /// Defines a logger for this class. @@ -82,22 +82,22 @@ public class childsplay : BaseQuest private static IArea Albion_Statue_Area = null; - public childsplay() + public ChildsPlay() : base() { } - public childsplay(GamePlayer questingPlayer) + public ChildsPlay(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public childsplay(GamePlayer questingPlayer, int step) + public ChildsPlay(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public childsplay(GamePlayer questingPlayer, DBQuest dbQuest) + public ChildsPlay(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -1482,7 +1482,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) GameEventMgr.AddHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles)); GameEventMgr.AddHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles)); - Charles.AddQuestToGive(typeof(childsplay)); + Charles.AddQuestToGive(typeof(ChildsPlay)); if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); } @@ -1502,7 +1502,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) GameEventMgr.RemoveHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles)); GameEventMgr.RemoveHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles)); - Charles.RemoveQuestToGive(typeof(childsplay)); + Charles.RemoveQuestToGive(typeof(ChildsPlay)); } protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) @@ -1511,10 +1511,10 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) if (player == null) return; - if (Charles.CanGiveQuest(typeof(childsplay), player) <= 0) + if (Charles.CanGiveQuest(typeof(ChildsPlay), player) <= 0) return; - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; Charles.TurnTo(player); @@ -1581,7 +1581,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) else if (lowerCase == LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.CaseText2")) { Charles.SayTo(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text5")); - player.Out.SendQuestSubscribeCommand(Charles, QuestMgr.GetIDForQuestType(typeof(childsplay)), LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text6")); + player.Out.SendQuestSubscribeCommand(Charles, QuestMgr.GetIDForQuestType(typeof(ChildsPlay)), LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text6")); } else if (lowerCase == LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.CaseText3")) { @@ -1596,7 +1596,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) /// true if qualified, false if not public override bool CheckQuestQualification(GamePlayer player) { - if (player.IsDoingQuest(typeof(childsplay)) != null) + if (player.IsDoingQuest(typeof(ChildsPlay)) != null) return true; if (player.Level < minimumLevel || player.Level > maximumLevel) @@ -1607,7 +1607,7 @@ public override bool CheckQuestQualification(GamePlayer player) private static void CheckPlayerAbortQuest(GamePlayer player, byte response) { - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; if (quest == null) return; @@ -1629,7 +1629,7 @@ protected static void SubscribeQuest(DOLEvent e, object sender, EventArgs args) if (qargs == null) return; - if (qargs.QuestID != QuestMgr.GetIDForQuestType(typeof(childsplay))) + if (qargs.QuestID != QuestMgr.GetIDForQuestType(typeof(ChildsPlay))) return; if (e == GamePlayerEvent.AcceptQuest) @@ -1642,7 +1642,7 @@ protected static void PlayerEnterStatueArea(DOLEvent e, object sender, EventArgs { AreaEventArgs aargs = args as AreaEventArgs; GamePlayer player = aargs.GameObject as GamePlayer; - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; if (quest != null && quest.Step == 1) { @@ -1653,10 +1653,10 @@ protected static void PlayerEnterStatueArea(DOLEvent e, object sender, EventArgs private static void CheckPlayerAcceptQuest(GamePlayer player, byte response) { - if (Charles.CanGiveQuest(typeof(childsplay), player) <= 0) + if (Charles.CanGiveQuest(typeof(ChildsPlay), player) <= 0) return; - if (player.IsDoingQuest(typeof(childsplay)) != null) + if (player.IsDoingQuest(typeof(ChildsPlay)) != null) return; if (response == 0x00) @@ -1665,7 +1665,7 @@ private static void CheckPlayerAcceptQuest(GamePlayer player, byte response) } else { - if (!Charles.GiveQuest(typeof(childsplay), player, 1)) + if (!Charles.GiveQuest(typeof(ChildsPlay), player, 1)) return; SendReply(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.CheckPlayerAcceptQuest.Text2")); } diff --git a/GameServerScripts/quests/Hibernia/ChildsPlay.cs b/GameServerScripts/quests/Hibernia/ChildsPlay.cs index 967908d13f..e762534792 100644 --- a/GameServerScripts/quests/Hibernia/ChildsPlay.cs +++ b/GameServerScripts/quests/Hibernia/ChildsPlay.cs @@ -46,7 +46,7 @@ namespace DOL.GS.Quests.Hibernia { - public class childsplay : BaseQuest + public class ChildsPlay : BaseQuest { /// /// Defines a logger for this class. @@ -82,22 +82,22 @@ public class childsplay : BaseQuest private static IArea Hib_Statue_Area = null; - public childsplay() + public ChildsPlay() : base() { } - public childsplay(GamePlayer questingPlayer) + public ChildsPlay(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public childsplay(GamePlayer questingPlayer, int step) + public ChildsPlay(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public childsplay(GamePlayer questingPlayer, DBQuest dbQuest) + public ChildsPlay(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -1481,7 +1481,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) GameEventMgr.AddHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles)); GameEventMgr.AddHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles)); - Charles.AddQuestToGive(typeof(childsplay)); + Charles.AddQuestToGive(typeof(ChildsPlay)); if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" (Hib) initialized"); } @@ -1501,7 +1501,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) GameEventMgr.RemoveHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles)); GameEventMgr.RemoveHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles)); - Charles.RemoveQuestToGive(typeof(childsplay)); + Charles.RemoveQuestToGive(typeof(ChildsPlay)); } protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) @@ -1510,10 +1510,10 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) if (player == null) return; - if (Charles.CanGiveQuest(typeof(childsplay), player) <= 0) + if (Charles.CanGiveQuest(typeof(ChildsPlay), player) <= 0) return; - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; Charles.TurnTo(player); @@ -1580,7 +1580,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) else if (lowerCase == LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.CaseText2")) { Charles.SayTo(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text5")); - player.Out.SendQuestSubscribeCommand(Charles, QuestMgr.GetIDForQuestType(typeof(childsplay)), LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text6")); + player.Out.SendQuestSubscribeCommand(Charles, QuestMgr.GetIDForQuestType(typeof(ChildsPlay)), LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text6")); } else if (lowerCase == LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.CaseText3")) { @@ -1595,7 +1595,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) /// true if qualified, false if not public override bool CheckQuestQualification(GamePlayer player) { - if (player.IsDoingQuest(typeof(childsplay)) != null) + if (player.IsDoingQuest(typeof(ChildsPlay)) != null) return true; if (player.Level < minimumLevel || player.Level > maximumLevel) @@ -1606,7 +1606,7 @@ public override bool CheckQuestQualification(GamePlayer player) private static void CheckPlayerAbortQuest(GamePlayer player, byte response) { - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; if (quest == null) return; @@ -1628,7 +1628,7 @@ protected static void SubscribeQuest(DOLEvent e, object sender, EventArgs args) if (qargs == null) return; - if (qargs.QuestID != QuestMgr.GetIDForQuestType(typeof(childsplay))) + if (qargs.QuestID != QuestMgr.GetIDForQuestType(typeof(ChildsPlay))) return; if (e == GamePlayerEvent.AcceptQuest) @@ -1640,7 +1640,7 @@ protected static void PlayerEnterStatueArea(DOLEvent e, object sender, EventArgs { AreaEventArgs aargs = args as AreaEventArgs; GamePlayer player = aargs.GameObject as GamePlayer; - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; if (quest != null && quest.Step == 1) { @@ -1650,10 +1650,10 @@ protected static void PlayerEnterStatueArea(DOLEvent e, object sender, EventArgs } private static void CheckPlayerAcceptQuest(GamePlayer player, byte response) { - if (Charles.CanGiveQuest(typeof(childsplay), player) <= 0) + if (Charles.CanGiveQuest(typeof(ChildsPlay), player) <= 0) return; - if (player.IsDoingQuest(typeof(childsplay)) != null) + if (player.IsDoingQuest(typeof(ChildsPlay)) != null) return; if (response == 0x00) @@ -1662,7 +1662,7 @@ private static void CheckPlayerAcceptQuest(GamePlayer player, byte response) } else { - if (!Charles.GiveQuest(typeof(childsplay), player, 1)) + if (!Charles.GiveQuest(typeof(ChildsPlay), player, 1)) return; SendReply(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.CheckPlayerAcceptQuest.Text2")); } diff --git a/GameServerScripts/quests/Midgard/Bad_Food.cs b/GameServerScripts/quests/Midgard/Bad_Food.cs index d96c53fc48..ced1f07c2d 100644 --- a/GameServerScripts/quests/Midgard/Bad_Food.cs +++ b/GameServerScripts/quests/Midgard/Bad_Food.cs @@ -44,7 +44,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class badfood : BaseQuest + public class BadFood : BaseQuest { /// /// Defines a logger for this class. @@ -82,19 +82,19 @@ public class badfood : BaseQuest /* * Constructor */ - public badfood() : base() + public BadFood() : base() { } - public badfood(GamePlayer questingPlayer) : this(questingPlayer, 1) + public BadFood(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public badfood(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public BadFood(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public badfood(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public BadFood(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -273,56 +273,56 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(badfood)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(BadFood)); QuestBehaviour a; a = builder.CreateBehaviour(Pedra,-1); a.AddTrigger(eTriggerType.Interact,null,Pedra); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.badfood),Pedra); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.badfood),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.BadFood),Pedra); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.BadFood),null,(eComparator)5); a.AddAction(eActionType.Talk,"Oh, I am not feeling very well at all. I don't think there's one member of this town that hasn't felt a little queasy at least (once?) from all the bad fish we've [eaten].",Pedra); AddBehaviour(a); a = builder.CreateBehaviour(Pedra,-1); a.AddTrigger(eTriggerType.Whisper,"eaten",Pedra); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.badfood),Pedra); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.badfood),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.BadFood),Pedra); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.BadFood),null,(eComparator)5); a.AddAction(eActionType.Talk,"Aye, and now Kedra, the healer, is busy sorting out the worst! It turns out we are ate some bad fish. Now, Kedra says she is running our of her cure, and doesn't have time to get any more of the ingredients! Do you think you could help?",Pedra); - a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.badfood),"Will you help the healer out?"); + a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.BadFood),"Will you help the healer out?"); AddBehaviour(a); a = builder.CreateBehaviour(Pedra,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.badfood)); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.badfood),Pedra); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.BadFood)); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.BadFood),Pedra); a.AddAction(eActionType.Talk,"Oh good! Talk to Kedra about bad fish. She'll tell you what needs to be done.",Pedra); - a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.badfood),2); + a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),2); AddBehaviour(a); a = builder.CreateBehaviour(Kedra,-1); a.AddTrigger(eTriggerType.Interact,null,Kedra); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.badfood),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),2,(eComparator)3); a.AddAction(eActionType.Talk,"Fish! The entire town has eaten bad fish! It is crazy! I told them not to! I told them the moon's position in the sky indicated a bad harvest of fish, but did anyone listen? And now, everyone is [sick].",Kedra); AddBehaviour(a); a = builder.CreateBehaviour(Kedra,-1); a.AddTrigger(eTriggerType.Whisper,"sick",Kedra); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.badfood),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),2,(eComparator)3); a.AddAction(eActionType.Talk,"Yes. Sick. Why are you here? Are you sick? You don't look sick to me. You can help me. I am running out of my cure! I don't have time to go get the [marine fungus] I need!",Kedra); AddBehaviour(a); a = builder.CreateBehaviour(Kedra,-1); a.AddTrigger(eTriggerType.Whisper,"marine fungus",Kedra); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.badfood),2,(eComparator)3); - a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.badfood),3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),2,(eComparator)3); + a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),3); a.AddAction(eActionType.Talk,"Aye. I mash it up and add herbs to it. It's a great cure! I need more though! Go get me a marine fungus. I will pay you for it! And the whole town will thank you, when they are through wretching up the illness, that is.",Kedra); AddBehaviour(a); a = builder.CreateBehaviour(Pedra,-1); a.AddTrigger(eTriggerType.EnemyKilled,"marine fungus",null); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.badfood),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),3,(eComparator)3); a.AddAction(eActionType.GiveItem,marinefungus,null); - a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.badfood),4); + a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),4); AddBehaviour(a); a = builder.CreateBehaviour(Kedra,-1); a.AddTrigger(eTriggerType.Interact,null,Kedra); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.badfood),4,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.BadFood),4,(eComparator)3); a.AddAction(eActionType.Talk,"Oh thank you! The stench of the ill is getting to me! I can make a few more batches of my cure after this, and then be done with it all! This will teach everyone to ignore me! Let's see if they eat the fish the next time I say the moon isn't right! Here, I hope this is enough. Thank you for your aid!",Kedra); a.AddAction(eActionType.GiveGold,305,null); a.AddAction(eActionType.GiveXP,20,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.badfood),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.BadFood),null); a.AddAction(eActionType.TakeItem,marinefungus,null); AddBehaviour(a); @@ -332,7 +332,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End - Pedra.AddQuestToGive(typeof (badfood)); + Pedra.AddQuestToGive(typeof (BadFood)); if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); } @@ -353,7 +353,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (Pedra == null) return; /* Now we remove the possibility to give this quest to players */ - Pedra.RemoveQuestToGive(typeof (badfood)); + Pedra.RemoveQuestToGive(typeof (BadFood)); } /* Now we set the quest name. @@ -404,7 +404,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (badfood)) != null) + if (player.IsDoingQuest(typeof (BadFood)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/Childs_Play.cs b/GameServerScripts/quests/Midgard/Childs_Play.cs index 02679a8baa..bce63a785e 100644 --- a/GameServerScripts/quests/Midgard/Childs_Play.cs +++ b/GameServerScripts/quests/Midgard/Childs_Play.cs @@ -45,7 +45,7 @@ namespace DOL.GS.Quests.Midgard { - public class childsplay : BaseQuest + public class ChildsPlay : BaseQuest { /// /// Defines a logger for this class. @@ -83,22 +83,22 @@ public class childsplay : BaseQuest private static IArea Mid_Statue_Area = null; - public childsplay() + public ChildsPlay() : base() { } - public childsplay(GamePlayer questingPlayer) + public ChildsPlay(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public childsplay(GamePlayer questingPlayer, int step) + public ChildsPlay(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public childsplay(GamePlayer questingPlayer, DBQuest dbQuest) + public ChildsPlay(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -1484,7 +1484,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) GameEventMgr.AddHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles)); GameEventMgr.AddHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles)); - Charles.AddQuestToGive(typeof(childsplay)); + Charles.AddQuestToGive(typeof(ChildsPlay)); if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); } @@ -1507,7 +1507,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) GameEventMgr.RemoveHandler(Charles, GameLivingEvent.Interact, new DOLEventHandler(TalkToCharles)); GameEventMgr.RemoveHandler(Charles, GameLivingEvent.WhisperReceive, new DOLEventHandler(TalkToCharles)); - Charles.RemoveQuestToGive(typeof(childsplay)); + Charles.RemoveQuestToGive(typeof(ChildsPlay)); } protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) @@ -1516,10 +1516,10 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) if (player == null) return; - if (Charles.CanGiveQuest(typeof(childsplay), player) <= 0) + if (Charles.CanGiveQuest(typeof(ChildsPlay), player) <= 0) return; - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; Charles.TurnTo(player); @@ -1586,7 +1586,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) else if (lowerCase == LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.CaseText2")) { Charles.SayTo(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text5")); - player.Out.SendQuestSubscribeCommand(Charles, QuestMgr.GetIDForQuestType(typeof(childsplay)), LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text6")); + player.Out.SendQuestSubscribeCommand(Charles, QuestMgr.GetIDForQuestType(typeof(ChildsPlay)), LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.Text6")); } else if (lowerCase == LanguageMgr.GetTranslation(player.Client, "ChildsPlay.TalkToCharles.CaseText3")) { @@ -1601,7 +1601,7 @@ protected static void TalkToCharles(DOLEvent e, object sender, EventArgs args) /// true if qualified, false if not public override bool CheckQuestQualification(GamePlayer player) { - if (player.IsDoingQuest(typeof(childsplay)) != null) + if (player.IsDoingQuest(typeof(ChildsPlay)) != null) return true; if (player.Level < minimumLevel || player.Level > maximumLevel) @@ -1612,7 +1612,7 @@ public override bool CheckQuestQualification(GamePlayer player) private static void CheckPlayerAbortQuest(GamePlayer player, byte response) { - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; if (quest == null) return; @@ -1634,7 +1634,7 @@ protected static void SubscribeQuest(DOLEvent e, object sender, EventArgs args) if (qargs == null) return; - if (qargs.QuestID != QuestMgr.GetIDForQuestType(typeof(childsplay))) + if (qargs.QuestID != QuestMgr.GetIDForQuestType(typeof(ChildsPlay))) return; if (e == GamePlayerEvent.AcceptQuest) @@ -1646,7 +1646,7 @@ protected static void PlayerEnterStatueArea(DOLEvent e, object sender, EventArgs { AreaEventArgs aargs = args as AreaEventArgs; GamePlayer player = aargs.GameObject as GamePlayer; - childsplay quest = player.IsDoingQuest(typeof(childsplay)) as childsplay; + ChildsPlay quest = player.IsDoingQuest(typeof(ChildsPlay)) as ChildsPlay; if (quest != null && quest.Step == 1) { @@ -1656,10 +1656,10 @@ protected static void PlayerEnterStatueArea(DOLEvent e, object sender, EventArgs } private static void CheckPlayerAcceptQuest(GamePlayer player, byte response) { - if (Charles.CanGiveQuest(typeof(childsplay), player) <= 0) + if (Charles.CanGiveQuest(typeof(ChildsPlay), player) <= 0) return; - if (player.IsDoingQuest(typeof(childsplay)) != null) + if (player.IsDoingQuest(typeof(ChildsPlay)) != null) return; if (response == 0x00) @@ -1668,7 +1668,7 @@ private static void CheckPlayerAcceptQuest(GamePlayer player, byte response) } else { - if (!Charles.GiveQuest(typeof(childsplay), player, 1)) + if (!Charles.GiveQuest(typeof(ChildsPlay), player, 1)) return; SendReply(player, LanguageMgr.GetTranslation(player.Client, "ChildsPlay.CheckPlayerAcceptQuest.Text2")); } diff --git a/GameServerScripts/quests/Midgard/Essence_of_Life.cs b/GameServerScripts/quests/Midgard/Essence_of_Life.cs index 5603265a99..7479bd5965 100644 --- a/GameServerScripts/quests/Midgard/Essence_of_Life.cs +++ b/GameServerScripts/quests/Midgard/Essence_of_Life.cs @@ -44,7 +44,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class essenceoflife : BaseQuest + public class EssenceOfLife : BaseQuest { /// /// Defines a logger for this class. @@ -84,19 +84,19 @@ public class essenceoflife : BaseQuest /* * Constructor */ - public essenceoflife() : base() + public EssenceOfLife() : base() { } - public essenceoflife(GamePlayer questingPlayer) : this(questingPlayer, 1) + public EssenceOfLife(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public essenceoflife(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public EssenceOfLife(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public essenceoflife(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public EssenceOfLife(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -347,26 +347,26 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(essenceoflife)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(EssenceOfLife)); QuestBehaviour a; a = builder.CreateBehaviour(Ballach,-1); a.AddTrigger(eTriggerType.Interact,null,Ballach); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.essenceoflife),Ballach); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),Ballach); a.AddAction(eActionType.Talk,"Greetings Guardian. I have some [business] that needs tended to. There is some coin involved in it for you.",Ballach); AddBehaviour(a); a = builder.CreateBehaviour(Ballach,-1); a.AddTrigger(eTriggerType.Whisper,"business",Ballach); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.essenceoflife),Ballach); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),Ballach); a.AddAction(eActionType.Talk,"I am running low on Essence of Life. Do you think you could retrieve some for me?",Ballach); - a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.essenceoflife),"Will you aid Ballach and retrieve some Essence of Life? [Levels 1-4]"); + a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),"Will you aid Ballach and retrieve some Essence of Life? [Levels 1-4]"); AddBehaviour(a); a = builder.CreateBehaviour(Ballach,-1); - a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.essenceoflife)); + a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.EssenceOfLife)); a.AddAction(eActionType.Talk,"No problem. See you.",Ballach); AddBehaviour(a); a = builder.CreateBehaviour(Ballach,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.essenceoflife)); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.essenceoflife),Ballach); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.EssenceOfLife)); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),Ballach); a.AddAction(eActionType.Talk,"Thank you very much for offering to help. Here, take this enchanted flask. You will need to find a grave in the Burial Grounds. When you find one, use the flask and capture the essence of life that rests in the buried persons remains.",Ballach); a.AddAction(eActionType.GiveItem,enchantedflask,Ballach); AddBehaviour(a); @@ -379,11 +379,11 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) a = builder.CreateBehaviour(Ballach,-1); a.AddTrigger(eTriggerType.Timer,"flask",null); a.AddAction(eActionType.ReplaceItem,enchantedflask,Flaskofetherealessence); - a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.essenceoflife),null); + a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),null); AddBehaviour(a); a = builder.CreateBehaviour(Ballach,-1); a.AddTrigger(eTriggerType.Interact,null,Ballach); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.essenceoflife),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),2,(eComparator)3); a.AddAction(eActionType.Talk,"Did you collect the essence for me? If so, hand me the flask.",Ballach); AddBehaviour(a); a = builder.CreateBehaviour(Ballach,-1); @@ -391,7 +391,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) a.AddAction(eActionType.Talk,"Thank you for taking on this task for me. You have replenished my supply. Here, take this small monetary reward.",Ballach); a.AddAction(eActionType.GiveXP,60,null); a.AddAction(eActionType.GiveGold,18,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.essenceoflife),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.EssenceOfLife),null); AddBehaviour(a); #endregion @@ -400,7 +400,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End - Ballach.AddQuestToGive(typeof (essenceoflife)); + Ballach.AddQuestToGive(typeof (EssenceOfLife)); if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); } @@ -421,7 +421,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (Ballach == null) return; /* Now we remove the possibility to give this quest to players */ - Ballach.RemoveQuestToGive(typeof (essenceoflife)); + Ballach.RemoveQuestToGive(typeof (EssenceOfLife)); } /* Now we set the quest name. @@ -466,7 +466,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (essenceoflife)) != null) + if (player.IsDoingQuest(typeof (EssenceOfLife)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/Mauler_Invasion.cs b/GameServerScripts/quests/Midgard/Mauler_Invasion.cs index ad4d2d856f..60c4da88b8 100644 --- a/GameServerScripts/quests/Midgard/Mauler_Invasion.cs +++ b/GameServerScripts/quests/Midgard/Mauler_Invasion.cs @@ -45,7 +45,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class maulerinvasion : BaseQuest + public class MaulerInvasion : BaseQuest { /// /// Defines a logger for this class. @@ -81,19 +81,19 @@ public class maulerinvasion : BaseQuest /* * Constructor */ - public maulerinvasion() : base() + public MaulerInvasion() : base() { } - public maulerinvasion(GamePlayer questingPlayer) : this(questingPlayer, 1) + public MaulerInvasion(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public maulerinvasion(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public MaulerInvasion(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public maulerinvasion(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public MaulerInvasion(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -228,110 +228,110 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(maulerinvasion)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(MaulerInvasion)); QuestBehaviour a; a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Interact,null,VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.maulerinvasion),VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),VikingKreimhilde); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk1"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper1"), VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.maulerinvasion), VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.MaulerInvasion), VikingKreimhilde); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk2"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper2"), VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.maulerinvasion),VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),VikingKreimhilde); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk3"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper3"), VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.maulerinvasion),VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),VikingKreimhilde); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk4"), null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper4"), VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.maulerinvasion),VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),VikingKreimhilde); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk5"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Whisper5"), VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.maulerinvasion),VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null,(eComparator)5); - a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.maulerinvasion), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.OfferQuest")); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),VikingKreimhilde); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null,(eComparator)5); + a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.MaulerInvasion), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.OfferQuest")); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); - a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.maulerinvasion)); + a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.MaulerInvasion)); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk6"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.maulerinvasion)); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.maulerinvasion),VikingKreimhilde); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.MaulerInvasion)); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),VikingKreimhilde); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk7"), VikingKreimhilde); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.EnemyKilled"), null); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),3,(eComparator)1); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),3,(eComparator)1); a.AddAction(eActionType.GiveItem,blackmaulercubpelt,null); - a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null); + a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.Interact,null,VikingKreimhilde); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),3,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk8"), VikingKreimhilde); - a.AddAction(eActionType.SetQuestStep,typeof(maulerinvasion),4); + a.AddAction(eActionType.SetQuestStep,typeof(MaulerInvasion),4); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.GiveItem,VikingKreimhilde,blackmaulercubpelt); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),4,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),4,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk9"), VikingKreimhilde); - a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),5); + a.AddAction(eActionType.SetQuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),5); a.AddAction(eActionType.TakeItem,blackmaulercubpelt,null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.GiveItem,VikingKreimhilde,blackmaulercubpelt); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),5,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),5,(eComparator)3); a.AddRequirement(eRequirementType.Level,1,null,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP,5,null); a.AddAction(eActionType.GiveGold,27,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null); a.AddAction(eActionType.TakeItem,blackmaulercubpelt,null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.GiveItem,VikingKreimhilde,blackmaulercubpelt); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),5,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),5,(eComparator)3); a.AddRequirement(eRequirementType.Level,2,null,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP,20,null); a.AddAction(eActionType.GiveGold,27,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null); a.AddAction(eActionType.TakeItem,blackmaulercubpelt,null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.GiveItem,VikingKreimhilde,blackmaulercubpelt); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),5,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),5,(eComparator)3); a.AddRequirement(eRequirementType.Level,3,null,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP,40,null); a.AddAction(eActionType.GiveGold,27,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null); a.AddAction(eActionType.TakeItem,blackmaulercubpelt,null); AddBehaviour(a); a = builder.CreateBehaviour(VikingKreimhilde,-1); a.AddTrigger(eTriggerType.GiveItem,VikingKreimhilde,blackmaulercubpelt); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.maulerinvasion),5,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),5,(eComparator)3); a.AddRequirement(eRequirementType.Level,4,null,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.MaulerInvasion.Talk10"), VikingKreimhilde); a.AddAction(eActionType.GiveXP,60,null); a.AddAction(eActionType.GiveGold,27,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.maulerinvasion),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.MaulerInvasion),null); a.AddAction(eActionType.TakeItem,blackmaulercubpelt,null); AddBehaviour(a); @@ -341,7 +341,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End - VikingKreimhilde.AddQuestToGive(typeof (maulerinvasion)); + VikingKreimhilde.AddQuestToGive(typeof (MaulerInvasion)); if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); } @@ -362,7 +362,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (VikingKreimhilde == null) return; /* Now we remove the possibility to give this quest to players */ - VikingKreimhilde.RemoveQuestToGive(typeof (maulerinvasion)); + VikingKreimhilde.RemoveQuestToGive(typeof (MaulerInvasion)); } /* Now we set the quest name. @@ -416,7 +416,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (maulerinvasion)) != null) + if (player.IsDoingQuest(typeof (MaulerInvasion)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/Mead_Run.cs b/GameServerScripts/quests/Midgard/Mead_Run.cs index da1c95b2bb..e90a487c7b 100644 --- a/GameServerScripts/quests/Midgard/Mead_Run.cs +++ b/GameServerScripts/quests/Midgard/Mead_Run.cs @@ -44,7 +44,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class meadrun : BaseQuest + public class MeadRun : BaseQuest { /// /// Defines a logger for this class. @@ -84,19 +84,19 @@ public class meadrun : BaseQuest /* * Constructor */ - public meadrun() : base() + public MeadRun() : base() { } - public meadrun(GamePlayer questingPlayer) : this(questingPlayer, 1) + public MeadRun(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public meadrun(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public MeadRun(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public meadrun(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public MeadRun(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -354,46 +354,46 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(meadrun)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(MeadRun)); QuestBehaviour a; a = builder.CreateBehaviour(Audun,-1); a.AddTrigger(eTriggerType.Interact,null,Audun); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.meadrun),Audun); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.meadrun),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MeadRun),Audun); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MeadRun),null,(eComparator)5); a.AddAction(eActionType.Talk,"Greetings. You appear to be down on your luck. I have a [proposition] for you if you're interested.",null); AddBehaviour(a); a = builder.CreateBehaviour(Audun,-1); a.AddTrigger(eTriggerType.Whisper,"proposition",Audun); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.meadrun),Audun); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.meadrun),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.MeadRun),Audun); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MeadRun),null,(eComparator)5); a.AddAction(eActionType.Talk,"I need to deliver some mead to the guards just inside the Burial Grounds. There is a bit of coin to be had if you would deliver the mead for me.",Audun); - a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.meadrun),"Will you deliver the mead for Audun? [Levels 1-4]"); + a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.MeadRun),"Will you deliver the mead for Audun? [Levels 1-4]"); AddBehaviour(a); a = builder.CreateBehaviour(Audun,-1); - a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.meadrun)); + a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.MeadRun)); a.AddAction(eActionType.Talk,"No problem. See you",Audun); AddBehaviour(a); a = builder.CreateBehaviour(Audun,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.meadrun)); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.MeadRun)); a.AddAction(eActionType.Talk,"Here take the mead to Guard Olja inside the entrance of the Burial Grounds.",Audun); a.AddAction(eActionType.GiveItem,bottleofmead,Audun); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.meadrun),Audun); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.MeadRun),Audun); AddBehaviour(a); a = builder.CreateBehaviour(GuardOlja,-1); a.AddTrigger(eTriggerType.GiveItem,GuardOlja,bottleofmead); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.meadrun),null); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.MeadRun),null); a.AddAction(eActionType.Talk,"Thanks. Here, take this empty bottle back to Auduan.",GuardOlja); a.AddAction(eActionType.GiveItem,emptybottle,GuardOlja); a.AddAction(eActionType.TakeItem,bottleofmead,null); - a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.meadrun),null); + a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.MeadRun),null); AddBehaviour(a); a = builder.CreateBehaviour(Audun,-1); a.AddTrigger(eTriggerType.GiveItem,Audun,emptybottle); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.meadrun),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.MeadRun),2,(eComparator)3); a.AddAction(eActionType.Talk,"Good work. Here is that bit of coin I was talking about. Check back with me later, and I may have more work for you.",Audun); a.AddAction(eActionType.GiveXP,5,null); a.AddAction(eActionType.GiveGold,27,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.meadrun),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.MeadRun),null); AddBehaviour(a); #endregion @@ -402,7 +402,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End if (Audun!=null) { - Audun.AddQuestToGive(typeof (meadrun)); + Audun.AddQuestToGive(typeof (MeadRun)); } if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); @@ -424,7 +424,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (Audun == null) return; /* Now we remove the possibility to give this quest to players */ - Audun.RemoveQuestToGive(typeof (meadrun)); + Audun.RemoveQuestToGive(typeof (MeadRun)); } /* Now we set the quest name. @@ -469,7 +469,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (meadrun)) != null) + if (player.IsDoingQuest(typeof (MeadRun)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/Rindas_Lost_Key.cs b/GameServerScripts/quests/Midgard/Rindas_Lost_Key.cs index 0a1a7e6962..8fde4b3f72 100644 --- a/GameServerScripts/quests/Midgard/Rindas_Lost_Key.cs +++ b/GameServerScripts/quests/Midgard/Rindas_Lost_Key.cs @@ -44,7 +44,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class rindaslostkey : BaseQuest + public class Rindaslostkey : BaseQuest { /// /// Defines a logger for this class. @@ -86,19 +86,19 @@ public class rindaslostkey : BaseQuest /* * Constructor */ - public rindaslostkey() : base() + public Rindaslostkey() : base() { } - public rindaslostkey(GamePlayer questingPlayer) : this(questingPlayer, 1) + public Rindaslostkey(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public rindaslostkey(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public Rindaslostkey(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public rindaslostkey(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public Rindaslostkey(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -429,62 +429,62 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(rindaslostkey)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(Rindaslostkey)); QuestBehaviour a; a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.Interact,null,DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.rindaslostkey),DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),DwarvenGuardRinda); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null,(eComparator)5); a.AddAction(eActionType.Talk,"Greetings, and welcome to the dwarf town of Haggerfel. I wish I could stay and talk with you for a moment, but I am in a hurry to find my [lost keys].",DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.Whisper,"lost keys",DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.rindaslostkey),DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),DwarvenGuardRinda); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null,(eComparator)5); a.AddAction(eActionType.Talk,"Oh yes. It is dreadful that I was so careless as to lost them like this! You see, I am responsible for helping to lock the money the merchants bring in during the day into a large chest. I am the only one with the keys, and I have [misplaced them].",DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.Whisper,"misplaced them",DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.rindaslostkey),DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),DwarvenGuardRinda); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null,(eComparator)5); a.AddAction(eActionType.Talk,"Oh, this makes me so angry! I have searched all around Haggerfel for them, but they are no where to be found. I don't suppose you would have a [little time] to help me out, would you?",DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.Whisper,"little time",DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.rindaslostkey),DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null,(eComparator)5); - a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.rindaslostkey),"Will you help Rinda find her keys?"); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),DwarvenGuardRinda); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null,(eComparator)5); + a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),"Will you help Rinda find her keys?"); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); - a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.rindaslostkey)); + a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.Rindaslostkey)); a.AddAction(eActionType.Talk,"No problem. See you",DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.rindaslostkey)); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.rindaslostkey),DwarvenGuardRinda); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.Rindaslostkey)); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),DwarvenGuardRinda); a.AddAction(eActionType.Talk,"Thank you! Thank you! I know there are some hobgoblins around that like to play jokes on people, viscious and mean ones. Why don't you check there while I check the merchant huts again?",DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(hobgoblinsnakefinder,-1); a.AddTrigger(eTriggerType.Interact,null,hobgoblinsnakefinder); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),1,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),1,(eComparator)3); a.AddAction(eActionType.Talk,"Ha ha! Me no have keys! Feed to hungry bear! haha! You no help Rinda...Gold be ours!",hobgoblinsnakefinder); a.AddAction(eActionType.GiveItem,ironkeychain,hobgoblinsnakefinder); - a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null); + a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.EnemyKilled,"black mauler cub",null); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),2,(eComparator)3); a.AddAction(eActionType.GiveItem,rindaskey,null); - a.AddAction(eActionType.IncQuestStep,typeof(rindaslostkey),null); + a.AddAction(eActionType.IncQuestStep,typeof(Rindaslostkey),null); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.Interact,null,DwarvenGuardRinda); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),3,(eComparator)3); a.AddAction(eActionType.Talk,"I couldn't find them again in the village. Did you have better luck?",DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.GiveItem,DwarvenGuardRinda,ironkeychain); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),3,(eComparator)3); a.AddAction(eActionType.Talk,"Oh my keychain. Well, this is a good start. But you didn't happen to find my key, did you?",DwarvenGuardRinda); a.AddAction(eActionType.GiveXP,20,null); a.AddAction(eActionType.GiveGold,225,null); @@ -492,24 +492,24 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.GiveItem,DwarvenGuardRinda,rindaskey); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),3,(eComparator)3); a.AddRequirement(eRequirementType.InventoryItem,ironkeychain,null,(eComparator)3); a.AddAction(eActionType.Talk,"Ah! This is great! My key! You have done a fabulous job in helping me. Please accept this coin in return for your time and effort. Thank you so much! Now, I can safely lock up the town's money. Thank you!",DwarvenGuardRinda); a.AddAction(eActionType.TakeItem,rindaskey,null); a.AddAction(eActionType.TakeItem,ironkeychain,null); a.AddAction(eActionType.GiveXP,40,null); a.AddAction(eActionType.GiveGold,450,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null); a.AddAction(eActionType.GiveItem,silverringofhealth,DwarvenGuardRinda); AddBehaviour(a); a = builder.CreateBehaviour(DwarvenGuardRinda,-1); a.AddTrigger(eTriggerType.GiveItem,DwarvenGuardRinda,rindaskey); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.rindaslostkey),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),3,(eComparator)3); a.AddRequirement(eRequirementType.InventoryItem,ironkeychain,null,(eComparator)1); a.AddAction(eActionType.Talk,"Ah! This is great! My key! You have done a fabulous job in helping me. Please accept this coin in return for your time and effort. Thank you so much! Now, I can safely lock up the town's money. Thank you!",DwarvenGuardRinda); a.AddAction(eActionType.GiveXP,20,null); a.AddAction(eActionType.GiveGold,225,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.rindaslostkey),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.Rindaslostkey),null); a.AddAction(eActionType.TakeItem,rindaskey,null); a.AddAction(eActionType.GiveItem,silverringofhealth,DwarvenGuardRinda); AddBehaviour(a); @@ -520,7 +520,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End if (DwarvenGuardRinda!=null) { - DwarvenGuardRinda.AddQuestToGive(typeof (rindaslostkey)); + DwarvenGuardRinda.AddQuestToGive(typeof (Rindaslostkey)); } if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); @@ -542,7 +542,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (DwarvenGuardRinda == null) return; /* Now we remove the possibility to give this quest to players */ - DwarvenGuardRinda.RemoveQuestToGive(typeof (rindaslostkey)); + DwarvenGuardRinda.RemoveQuestToGive(typeof (Rindaslostkey)); } /* Now we set the quest name. @@ -590,7 +590,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (rindaslostkey)) != null) + if (player.IsDoingQuest(typeof (Rindaslostkey)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/Sveabone_Hilt_Sword.cs b/GameServerScripts/quests/Midgard/Sveabone_Hilt_Sword.cs index 34d16e8ab5..1f4120a3d5 100644 --- a/GameServerScripts/quests/Midgard/Sveabone_Hilt_Sword.cs +++ b/GameServerScripts/quests/Midgard/Sveabone_Hilt_Sword.cs @@ -44,7 +44,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class sveabonehiltsword : BaseQuest + public class SveaboneHiltSword : BaseQuest { /// /// Defines a logger for this class. @@ -84,19 +84,19 @@ public class sveabonehiltsword : BaseQuest /* * Constructor */ - public sveabonehiltsword() : base() + public SveaboneHiltSword() : base() { } - public sveabonehiltsword(GamePlayer questingPlayer) : this(questingPlayer, 1) + public SveaboneHiltSword(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public sveabonehiltsword(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public SveaboneHiltSword(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public sveabonehiltsword(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public SveaboneHiltSword(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -386,57 +386,57 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(sveabonehiltsword)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(SveaboneHiltSword)); QuestBehaviour a; a = builder.CreateBehaviour(Gridash,-1); a.AddTrigger(eTriggerType.Interact,null,Gridash); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),Gridash); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),Gridash); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),null,(eComparator)5); a.AddAction(eActionType.Talk,"Hail young one! I have noticed that you do not carry one of my fine [bone hilt swords].",Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); a.AddTrigger(eTriggerType.Whisper,"bone hilt swords",Gridash); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),Gridash); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),Gridash); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),null,(eComparator)5); a.AddAction(eActionType.Talk,"Aye! They are some of my finest works! I don't suppose you [would care for one] eh?",Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); a.AddTrigger(eTriggerType.Whisper,"would care for one",Gridash); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),Gridash); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),null,(eComparator)5); - a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),"Will you do what is asked so that Gridash can make a Sveabone hilt sword?"); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),Gridash); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),null,(eComparator)5); + a.AddAction(eActionType.OfferQuest,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),"Will you do what is asked so that Gridash can make a Sveabone hilt sword?"); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); - a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword)); + a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword)); a.AddAction(eActionType.Talk,"No problem. See you",Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword)); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword)); a.AddAction(eActionType.Talk,"Oh great then! Run along and buy me a bronze short sword. I should be ready once you return.",Gridash); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),Gridash); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),Gridash); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); a.AddTrigger(eTriggerType.GiveItem,Gridash,bronze_short_sword); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),null); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),null); a.AddAction(eActionType.Talk,"Good work! I cannot seem to find anymore sveawolf teeth to fashion your weapon. Find one and return it to me.",Gridash); a.AddAction(eActionType.TakeItem,bronze_short_sword,null); - a.AddAction(eActionType.IncQuestStep,typeof(sveabonehiltsword),null); + a.AddAction(eActionType.IncQuestStep,typeof(SveaboneHiltSword),null); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); a.AddTrigger(eTriggerType.EnemyKilled,"young sveawof",null); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),2,(eComparator)3); a.AddAction(eActionType.GiveItem,sveawolftooth,null); - a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),null); + a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),null); AddBehaviour(a); a = builder.CreateBehaviour(Gridash,-1); a.AddTrigger(eTriggerType.GiveItem,Gridash,sveawolftooth); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),3,(eComparator)3); a.AddAction(eActionType.Talk,"Here is your completed work. I hope it serves you well!",Gridash); a.AddAction(eActionType.TakeItem,sveawolftooth,null); a.AddAction(eActionType.GiveItem,sveabone_hilt_sword,Gridash); a.AddAction(eActionType.GiveXP,20,null); a.AddAction(eActionType.GiveGold,450,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.sveabonehiltsword),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.SveaboneHiltSword),null); AddBehaviour(a); #endregion @@ -445,7 +445,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End if (Gridash!=null) { - Gridash.AddQuestToGive(typeof (sveabonehiltsword)); + Gridash.AddQuestToGive(typeof (SveaboneHiltSword)); } if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); @@ -467,7 +467,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (Gridash == null) return; /* Now we remove the possibility to give this quest to players */ - Gridash.RemoveQuestToGive(typeof (sveabonehiltsword)); + Gridash.RemoveQuestToGive(typeof (SveaboneHiltSword)); } /* Now we set the quest name. @@ -515,7 +515,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (sveabonehiltsword)) != null) + if (player.IsDoingQuest(typeof (SveaboneHiltSword)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/The_Birthday_Gift.cs b/GameServerScripts/quests/Midgard/The_Birthday_Gift.cs index 52c59994b3..24866ff242 100644 --- a/GameServerScripts/quests/Midgard/The_Birthday_Gift.cs +++ b/GameServerScripts/quests/Midgard/The_Birthday_Gift.cs @@ -45,7 +45,7 @@ namespace DOL.GS.Quests.Midgard { * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class thebirthdaygift : BaseQuest + public class TheBirthDayGift : BaseQuest { /// /// Defines a logger for this class. @@ -84,19 +84,19 @@ public class thebirthdaygift : BaseQuest /* * Constructor */ - public thebirthdaygift() : base() + public TheBirthDayGift() : base() { } - public thebirthdaygift(GamePlayer questingPlayer) : this(questingPlayer, 1) + public TheBirthDayGift(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public thebirthdaygift(GamePlayer questingPlayer, int step) : base(questingPlayer, step) + public TheBirthDayGift(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public thebirthdaygift(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) + public TheBirthDayGift(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -345,99 +345,99 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(thebirthdaygift)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(TheBirthDayGift)); QuestBehaviour a; a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Interact,null,BarkeepNognar); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),BarkeepNognar); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),BarkeepNognar); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk1"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper1"), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),BarkeepNognar); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),BarkeepNognar); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk2"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper2"), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.TheBirthDayGift), BarkeepNognar); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk3"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper3"), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),BarkeepNognar); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),BarkeepNognar); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk4"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper4"), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),BarkeepNognar); - a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null,(eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),BarkeepNognar); + a.AddRequirement(eRequirementType.QuestPending,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null,(eComparator)5); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk5"), BarkeepNognar); - a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.OfferQuest")); + a.AddAction(eActionType.OfferQuest, typeof(DOL.GS.Quests.Midgard.TheBirthDayGift), LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.OfferQuest")); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); - a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.thebirthdaygift)); + a.AddTrigger(eTriggerType.DeclineQuest,null,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift)); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk6"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); - a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.thebirthdaygift)); - a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),BarkeepNognar); + a.AddTrigger(eTriggerType.AcceptQuest,null,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift)); + a.AddAction(eActionType.GiveQuest,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),BarkeepNognar); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk7"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper5"), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),1,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),1,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk8"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.EnemyKilled, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.EnemyKilled"), null); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),1,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),1,(eComparator)3); a.AddAction(eActionType.GiveItem,rattlingskeletonpendant,null); - a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null); + a.AddAction(eActionType.IncQuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Interact,null,BarkeepNognar); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),2,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk9"), BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.GiveItem,BarkeepNognar,rattlingskeletonpendant); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),2,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk10"), BarkeepNognar); a.AddAction(eActionType.TakeItem, rattlingskeletonpendant, null); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepNognar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper6"), BarkeepNognar); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),2,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),2,(eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, rattlingskeletonpendant, 0, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk11"), BarkeepNognar); - a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.thebirthdaygift), null); + a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.TheBirthDayGift), null); a.AddAction(eActionType.GiveItem,giftandnoteforprugar,BarkeepNognar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepPrugar,-1); a.AddTrigger(eTriggerType.Interact,null,BarkeepPrugar); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),3,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk12"), BarkeepPrugar); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepPrugar,-1); a.AddTrigger(eTriggerType.GiveItem,BarkeepPrugar,giftandnoteforprugar); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),3,(eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk13"), BarkeepPrugar); a.AddAction(eActionType.TakeItem, giftandnoteforprugar, null); AddBehaviour(a); a = builder.CreateBehaviour(BarkeepPrugar,-1); a.AddTrigger(eTriggerType.Whisper, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Whisper7"), BarkeepPrugar); - a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),3,(eComparator)3); + a.AddRequirement(eRequirementType.QuestStep,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),3,(eComparator)3); a.AddRequirement(eRequirementType.InventoryItem, giftandnoteforprugar, 0, (eComparator)3); a.AddAction(eActionType.Talk, LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "Mid.TheBirthdayGift.Talk14"), BarkeepPrugar); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold,27,null); - a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.thebirthdaygift),null); + a.AddAction(eActionType.FinishQuest,typeof(DOL.GS.Quests.Midgard.TheBirthDayGift),null); AddBehaviour(a); #endregion @@ -446,7 +446,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End if (BarkeepNognar!=null) { - BarkeepNognar.AddQuestToGive(typeof (thebirthdaygift)); + BarkeepNognar.AddQuestToGive(typeof (TheBirthDayGift)); } if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); @@ -468,7 +468,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (BarkeepNognar == null) return; /* Now we remove the possibility to give this quest to players */ - BarkeepNognar.RemoveQuestToGive(typeof (thebirthdaygift)); + BarkeepNognar.RemoveQuestToGive(typeof (TheBirthDayGift)); } /* Now we set the quest name. @@ -516,7 +516,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof (thebirthdaygift)) != null) + if (player.IsDoingQuest(typeof (TheBirthDayGift)) != null) return true; // Custom Code Begin diff --git a/GameServerScripts/quests/Midgard/Trial_of_Strength.cs b/GameServerScripts/quests/Midgard/Trial_of_Strength.cs index 11e03be243..744072e772 100644 --- a/GameServerScripts/quests/Midgard/Trial_of_Strength.cs +++ b/GameServerScripts/quests/Midgard/Trial_of_Strength.cs @@ -45,7 +45,7 @@ namespace DOL.GS.Quests.Midgard * as Quest. To do this, we derive from the abstract class * BaseQuest */ - public class trialofstrength : BaseQuest + public class TrialOfStrength : BaseQuest { /// /// Defines a logger for this class. @@ -83,22 +83,22 @@ public class trialofstrength : BaseQuest /* * Constructor */ - public trialofstrength() + public TrialOfStrength() : base() { } - public trialofstrength(GamePlayer questingPlayer) + public TrialOfStrength(GamePlayer questingPlayer) : this(questingPlayer, 1) { } - public trialofstrength(GamePlayer questingPlayer, int step) + public TrialOfStrength(GamePlayer questingPlayer, int step) : base(questingPlayer, step) { } - public trialofstrength(GamePlayer questingPlayer, DBQuest dbQuest) + public TrialOfStrength(GamePlayer questingPlayer, DBQuest dbQuest) : base(questingPlayer, dbQuest) { } @@ -284,107 +284,107 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) #region defineQuestParts - QuestBuilder builder = QuestMgr.getBuilder(typeof(trialofstrength)); + QuestBuilder builder = QuestMgr.getBuilder(typeof(TrialOfStrength)); QuestBehaviour a; a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestGivable, typeof(trialofstrength), ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(TrialOfStrength), ToroldSterkkriger); + a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Vikings to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Viking like you by the presence of [Morvaltar].", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Interact, null, ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), ToroldSterkkriger); + a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "Hail. I am Torold, and I shall be your trainer in this wild land. King Goran Stonefist and his brother Stonelock have charged me with training all young Rogue to prepare them to join the ranks of King Goran's army to aid in the exploration of Aegir. Aegir is a wild, untamed place, and it's made even more dangerous for a your Rogue like you by the presence of [Morvaltar].", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "Morvaltar", ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), ToroldSterkkriger); + a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null, (eComparator)5); a.AddAction(eActionType.Talk, "As you may know, the Morvaltar are your wild cousins. We of Midgard do not fear Valkyn like you, for as a group you have more than proven your loyalty to King Goran. Many Valkyn have also proven that they are strong, intelligent, and brave. These are [the qualities] that all Vikings must possess before they can choose where their destiny lies.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), ToroldSterkkriger); + a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Vikings from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "the qualities", ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), ToroldSterkkriger); + a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null, (eComparator)5); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "Now, young one, prepare yourself. You have three trials to face before I can allow you to make your destiny. These trials are designed to separate the true Rogues from the everyday Valkyn. So, prepare yourself now, for you trial is waiting for you. It is a test to [prove your strength]. Only the strongest will survive in this land.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.Whisper, "prove your strength", ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); - a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.trialofstrength), null, (eComparator)5); - a.AddAction(eActionType.OfferQuest, typeof(trialofstrength), "Will you prove you have the strength to survive in the land of Aegir?"); + a.AddRequirement(eRequirementType.QuestGivable, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), ToroldSterkkriger); + a.AddRequirement(eRequirementType.QuestPending, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null, (eComparator)5); + a.AddAction(eActionType.OfferQuest, typeof(TrialOfStrength), "Will you prove you have the strength to survive in the land of Aegir?"); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); - a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength)); + a.AddTrigger(eTriggerType.DeclineQuest, null, typeof(DOL.GS.Quests.Midgard.TrialOfStrength)); a.AddAction(eActionType.Talk, "No problem. See you", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); - a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.trialofstrength)); - a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), ToroldSterkkriger); + a.AddTrigger(eTriggerType.AcceptQuest, null, typeof(DOL.GS.Quests.Midgard.TrialOfStrength)); + a.AddAction(eActionType.GiveQuest, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), ToroldSterkkriger); a.AddAction(eActionType.Talk, "Seek out Jorund Bruttstein in Aegirhamn. Tell him your name when he asks.", ToroldSterkkriger); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 1, (eComparator)3); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Lo, I see a young Viking before me. What is your name? Speak up!", JorundBruttstein); a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein); - a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); + a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 1, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 1, (eComparator)3); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "Lo, I see a young Rogue before me. What is your name? Speak up!", JorundBruttstein); a.AddAction(eActionType.Talk, "You are here to prove that you have the strength in you to endure in this land. The trial is simple in nature, but unless you are strong, may prove difficult to execute. You must venture out and face [one of the creatures] that roam this land.", JorundBruttstein); - a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); + a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Whisper, "one of the creatures", JorundBruttstein); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 2, (eComparator)3); a.AddAction(eActionType.Talk, "You must seek out a marine fungus. They may be found in the waters south and southwest of here. Find one and defeat it. Once you have, obtain proof that you have accomplished this test. Return to me here.", JorundBruttstein); AddBehaviour(a); a = builder.CreateBehaviour(ToroldSterkkriger, -1); a.AddTrigger(eTriggerType.EnemyKilled, "marine fungus", null); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 2, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 2, (eComparator)3); a.AddAction(eActionType.GiveItem, marinefungusroot, null); - a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); + a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.Interact, null, JorundBruttstein); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 3, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 3, (eComparator)3); a.AddAction(eActionType.Talk, "So, you managed to survive, but anyone can run away. Show me the proof you defeated the marine fungus.", JorundBruttstein); - a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); + a.AddAction(eActionType.IncQuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 4, (eComparator)3); a.AddRequirement(eRequirementType.Class, 35, false); a.AddAction(eActionType.Talk, "Well done. I do not like to be so rough with young Vikings, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 230, null); - a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); + a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null); AddBehaviour(a); a = builder.CreateBehaviour(JorundBruttstein, -1); a.AddTrigger(eTriggerType.GiveItem, JorundBruttstein, marinefungusroot); - a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.trialofstrength), 4, (eComparator)3); + a.AddRequirement(eRequirementType.QuestStep, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), 4, (eComparator)3); a.AddRequirement(eRequirementType.Class, 38, false); a.AddAction(eActionType.Talk, "\"Well done. I do not like to be so rough with young Rogues, but I must be. I do not want to see anyone die because I failed to do my job. But you have proven that you have the potential for great strength. I shall let your trainer know of your success.", JorundBruttstein); a.AddAction(eActionType.GiveXP, 20, null); a.AddAction(eActionType.GiveGold, 230, null); - a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.trialofstrength), null); + a.AddAction(eActionType.FinishQuest, typeof(DOL.GS.Quests.Midgard.TrialOfStrength), null); AddBehaviour(a); #endregion @@ -394,7 +394,7 @@ public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args) // Custom Scriptloaded Code End if (ToroldSterkkriger != null) { - ToroldSterkkriger.AddQuestToGive(typeof(trialofstrength)); + ToroldSterkkriger.AddQuestToGive(typeof(TrialOfStrength)); } if (log.IsInfoEnabled) log.Info("Quest \"" + questTitle + "\" initialized"); @@ -416,7 +416,7 @@ public static void ScriptUnloaded(DOLEvent e, object sender, EventArgs args) if (ToroldSterkkriger == null) return; /* Now we remove the possibility to give this quest to players */ - ToroldSterkkriger.RemoveQuestToGive(typeof(trialofstrength)); + ToroldSterkkriger.RemoveQuestToGive(typeof(TrialOfStrength)); } /* Now we set the quest name. @@ -467,7 +467,7 @@ public override string Description public override bool CheckQuestQualification(GamePlayer player) { // if the player is already doing the quest his level is no longer of relevance - if (player.IsDoingQuest(typeof(trialofstrength)) != null) + if (player.IsDoingQuest(typeof(TrialOfStrength)) != null) return true; // Custom Code Begin diff --git a/Tests/IntegrationTests/DOLBase/Test_MPK.cs b/Tests/IntegrationTests/DOLBase/Test_MPK.cs index d4153fda06..5d430a64fb 100644 --- a/Tests/IntegrationTests/DOLBase/Test_MPK.cs +++ b/Tests/IntegrationTests/DOLBase/Test_MPK.cs @@ -35,10 +35,10 @@ public void Save_TestTxtToMPK_CorrectCRC() newMPK[textFileLocation].Header.TimeStamp = 0; //Make MPK creation deterministic newMPK.Save(); - Assert.AreEqual(1, newMPK.Count); + Assert.That(newMPK.Count, Is.EqualTo(1)); var expectedCRCValue = 375344986; - Assert.AreEqual(expectedCRCValue, newMPK.CRCValue); + Assert.That(newMPK.CRCValue, Is.EqualTo(expectedCRCValue)); } [Test, Order(2)] @@ -55,7 +55,7 @@ public void Extract_TestMPK_SameTxtContent() var actualFileText = File.ReadAllText(Path.Combine(extractPath, textFileLocation)); var expectedFileText = textFileContent; - Assert.AreEqual(expectedFileText, actualFileText); + Assert.That(actualFileText, Is.EqualTo(expectedFileText)); } [OneTimeTearDown] diff --git a/Tests/IntegrationTests/Database/CustomParamsTest.cs b/Tests/IntegrationTests/Database/CustomParamsTest.cs index 51e233a601..c62a55407d 100644 --- a/Tests/IntegrationTests/Database/CustomParamsTest.cs +++ b/Tests/IntegrationTests/Database/CustomParamsTest.cs @@ -50,36 +50,36 @@ public void TableParamSaveLoadTest() Database.DeleteObject(obj); // Check Dynamic object is not Persisted - Assert.IsFalse(TestData.IsPersisted, "Newly Created Data Object should not be persisted..."); - Assert.IsFalse(TestData.CustomParams.First().IsPersisted, "Newly Created Param Object should not be persisted..."); + Assert.That(TestData.IsPersisted, Is.False, "Newly Created Data Object should not be persisted..."); + Assert.That(TestData.CustomParams.First().IsPersisted, Is.False, "Newly Created Param Object should not be persisted..."); // Insert Object var paramsInserted = TestData.CustomParams.Select(o => Database.AddObject(o)).ToArray(); var inserted = Database.AddObject(TestData); - Assert.IsTrue(inserted, "Test Object not inserted properly in Database !"); - Assert.IsTrue(paramsInserted.All(result => result), "Params Objects not inserted properly in Database !"); + Assert.That(inserted, Is.True, "Test Object not inserted properly in Database !"); + Assert.That(paramsInserted.All(result => result), Is.True, "Params Objects not inserted properly in Database !"); // Check Saved Object is Persisted - Assert.IsTrue(TestData.IsPersisted, "Newly Created Data Object should be persisted..."); - Assert.IsTrue(TestData.CustomParams.First().IsPersisted, "Newly Created Param Object should be persisted..."); + Assert.That(TestData.IsPersisted, Is.True, "Newly Created Data Object should be persisted..."); + Assert.That(TestData.CustomParams.First().IsPersisted, Is.True, "Newly Created Param Object should be persisted..."); // Retrieve Object From Database var RetrieveData = Database.FindObjectByKey(TestData.ObjectId); // Check Retrieved object is Persisted - Assert.IsTrue(RetrieveData.IsPersisted, "Retrieved Data Object should be persisted..."); - Assert.IsTrue(RetrieveData.CustomParams.First().IsPersisted, "Retrieved Param Object should be persisted..."); + Assert.That(RetrieveData.IsPersisted, Is.True, "Retrieved Data Object should be persisted..."); + Assert.That(RetrieveData.CustomParams.First().IsPersisted, Is.True, "Retrieved Param Object should be persisted..."); // Compare both Objects - Assert.AreEqual(TestData.ObjectId, RetrieveData.ObjectId, "Newly Created and Inserted Data Object should have the same ID than Retrieved Object."); + Assert.That(RetrieveData.ObjectId, Is.EqualTo(TestData.ObjectId), "Newly Created and Inserted Data Object should have the same ID than Retrieved Object."); - Assert.AreEqual(TestData.CustomParams.Length, - RetrieveData.CustomParams.Length, + Assert.That(RetrieveData.CustomParams.Length, + Is.EqualTo(TestData.CustomParams.Length), "Saved Object and Retrieved Object doesn't have the same amount of Custom Params"); - Assert.AreEqual(TestData.CustomParams.First(param => param.KeyName == "TestParam").Value, - RetrieveData.CustomParams.First(param => param.KeyName == "TestParam").Value, + Assert.That(RetrieveData.CustomParams.First(param => param.KeyName == "TestParam").Value, + Is.EqualTo(TestData.CustomParams.First(param => param.KeyName == "TestParam").Value), "Both Saved Object and Retrieved Object should have similar Custom Params..."); } } diff --git a/Tests/IntegrationTests/Database/DatabaseTests.cs b/Tests/IntegrationTests/Database/DatabaseTests.cs index 69019adeae..2ee68ea1b7 100644 --- a/Tests/IntegrationTests/Database/DatabaseTests.cs +++ b/Tests/IntegrationTests/Database/DatabaseTests.cs @@ -49,7 +49,7 @@ public void TestTable() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTable."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTable."); var testValues = new [] { "TestValue 1", "TestValue 2", "TestValue 3" }; @@ -62,33 +62,33 @@ public void TestTable() }; var inserted = Database.AddObject(data); - Assert.IsTrue(inserted, "TestTable Entry not Inserted properly for Value {0}.", values); + Assert.That(inserted, Is.True, "TestTable Entry not Inserted properly for Value {0}.", values); } var retrieve = Database.SelectAllObjects(); - Assert.AreEqual(testValues.Length, retrieve.Count, "Retrieved Test Table Entries Count is not equals to Test Values Count."); + Assert.That(retrieve.Count, Is.EqualTo(testValues.Length), "Retrieved Test Table Entries Count is not equals to Test Values Count."); - CollectionAssert.AreEquivalent(testValues, retrieve.Select(o => o.TestField), "Retrieved Test Entries and Test Values should be Equivalent."); - Assert.IsTrue(retrieve.All(o => o.IsPersisted), "All Retrieved Test Entries should be Persisted in database."); + Assert.That(retrieve.Select(o => o.TestField), Is.EquivalentTo(testValues), "Retrieved Test Entries and Test Values should be Equivalent."); + Assert.That(retrieve.All(o => o.IsPersisted), Is.True, "All Retrieved Test Entries should be Persisted in database."); // Modify Some Data var modObj = retrieve.First(o => o.TestField == testValues.First()); modObj.TestField = "TestValue 4"; - Assert.IsTrue(modObj.Dirty, "Test Table Object should be Dirty after Modifications."); + Assert.That(modObj.Dirty, Is.True, "Test Table Object should be Dirty after Modifications."); var saved = Database.SaveObject(modObj); - Assert.IsTrue(saved, "Test Table Object could not be saved correctly."); + Assert.That(saved, Is.True, "Test Table Object could not be saved correctly."); - Assert.IsFalse(modObj.Dirty, "Test Table Object should not be Dirty after Object Save."); + Assert.That(modObj.Dirty, Is.False, "Test Table Object should not be Dirty after Object Save."); testValues = new [] { modObj.TestField, "TestValue 2", "TestValue 3" }; retrieve = Database.SelectAllObjects(); - CollectionAssert.AreEquivalent(testValues, retrieve.Select(o => o.TestField), "Retrieved Test Entries after Modification should be Equivalent to Test Values."); + Assert.That(retrieve.Select(o => o.TestField), Is.EquivalentTo(testValues), "Retrieved Test Entries after Modification should be Equivalent to Test Values."); // Delete Some Data @@ -96,32 +96,32 @@ public void TestTable() var deleted = Database.DeleteObject(delObj); - Assert.IsTrue(deleted, "Test Table Object could not be deleted correctly."); - Assert.IsTrue(delObj.IsDeleted, "Test Table Deleted Object does not have delete flags set correctly."); + Assert.That(deleted, Is.True, "Test Table Object could not be deleted correctly."); + Assert.That(delObj.IsDeleted, Is.True, "Test Table Deleted Object does not have delete flags set correctly."); testValues = retrieve.Skip(1).Select(o => o.TestField).ToArray(); retrieve = Database.SelectAllObjects(); - CollectionAssert.AreEquivalent(testValues, retrieve.Select(o => o.TestField), "Retrieved Test Entries after Deletion should be Equivalent to Test Values."); + Assert.That(retrieve.Select(o => o.TestField), Is.EquivalentTo(testValues), "Retrieved Test Entries after Deletion should be Equivalent to Test Values."); // Find Object By Key var keyObject = retrieve.First(); Assert.That(keyObject.ObjectId, Is.Not.Null.Or.Empty, "Test Table Retrieved Object should have an Object Id"); var retrieveKeyObj = Database.FindObjectByKey(keyObject.ObjectId); - Assert.IsNotNull(retrieveKeyObj, "Test Table Retrieved Object by Key should not be null."); - Assert.AreEqual(retrieveKeyObj.ObjectId, keyObject.ObjectId, "Test Table Key Object and Retrieved Key Object should have same Object Id."); - Assert.AreEqual(retrieveKeyObj.TestField, keyObject.TestField, "Test Table Key Object and Retrieved Key Object should have same Values."); + Assert.That(retrieveKeyObj, Is.Not.Null, "Test Table Retrieved Object by Key should not be null."); + Assert.That(keyObject.ObjectId, Is.EqualTo(retrieveKeyObj.ObjectId), "Test Table Key Object and Retrieved Key Object should have same Object Id."); + Assert.That(keyObject.TestField, Is.EqualTo(retrieveKeyObj.TestField), "Test Table Key Object and Retrieved Key Object should have same Values."); // Find Objects by Key var keys = retrieve.Take(2).Select(r => r.ObjectId).Append("__bad__id__").ToList(); var retrieveKeyObjects = Database.FindObjectsByKey(keys); - Assert.IsNotNull(retrieveKeyObjects, "Test Table Retrieved Objects by Key should not be null."); - Assert.IsTrue(retrieveKeyObjects.Count == 3, "Test Table Retrieved Objects by Key should contains 3 objects"); - Assert.IsTrue(keys.Contains(retrieveKeyObjects[0].ObjectId), "Test Table first Key Object and Retrieved first Key Object should have same Object Id."); - Assert.IsTrue(keys.Contains(retrieveKeyObjects[1].ObjectId), "Test Table second Key Object and Retrieved second Key Object should have same Object Id."); - Assert.IsNull(retrieveKeyObjects[2], "Test Table third object should be null (it's an invalid id)"); + Assert.That(retrieveKeyObjects, Is.Not.Null, "Test Table Retrieved Objects by Key should not be null."); + Assert.That(retrieveKeyObjects.Count == 3, Is.True, "Test Table Retrieved Objects by Key should contains 3 objects"); + Assert.That(keys.Contains(retrieveKeyObjects[0].ObjectId), Is.True, "Test Table first Key Object and Retrieved first Key Object should have same Object Id."); + Assert.That(keys.Contains(retrieveKeyObjects[1].ObjectId), Is.True, "Test Table second Key Object and Retrieved second Key Object should have same Object Id."); + Assert.That(retrieveKeyObjects[2], Is.Null, "Test Table third object should be null (it's an invalid id)"); } /// @@ -140,51 +140,51 @@ public void TestTableAutoIncrement() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableAutoInc."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableAutoInc."); var addObj = new TestTableAutoInc() { TestField = "Test AutoInc" }; // Insert a Test Object for guessing last auto increment var inserted = Database.AddObject(addObj); - Assert.IsTrue(inserted, "Test Table Auto Inc could not insert a new Entry."); + Assert.That(inserted, Is.True, "Test Table Auto Inc could not insert a new Entry."); var autoInc = addObj.PrimaryKey; - Assert.AreNotEqual(autoInc, default(int), "Test Table Auto Inc Primary should not be Default value after insertion."); + Assert.That(default(int), Is.Not.EqualTo(autoInc), "Test Table Auto Inc Primary should not be Default value after insertion."); // Add Another Object to Check Primary Key Increment var otherObj = new TestTableAutoInc() { TestField = "Test AutoInc Other" }; var otherInsert = Database.AddObject(otherObj); - Assert.IsTrue(otherInsert, "Test Table Auto Inc could not insert an other Entry."); + Assert.That(otherInsert, Is.True, "Test Table Auto Inc could not insert an other Entry."); var otherAutoInc = otherObj.PrimaryKey; - Assert.Greater(otherAutoInc, autoInc, "Newly Inserted Test Table Auto Inc Other Entry should have a Greater Primary Key Increment."); + Assert.That(otherAutoInc, Is.GreaterThan(autoInc), "Newly Inserted Test Table Auto Inc Other Entry should have a Greater Primary Key Increment."); // Try Deleting and Re-inserting var reDeleted = Database.DeleteObject(otherObj); - Assert.IsTrue(reDeleted, "Test Table Auto Inc could not delete other Entry from Table."); - Assert.IsTrue(otherObj.IsDeleted, "Test Table Auto Inc other Entry deleted Flag should be true."); - Assert.IsFalse(otherObj.IsPersisted, "Test Table Auto Inc other Entry Persisted Flag should be false."); + Assert.That(reDeleted, Is.True, "Test Table Auto Inc could not delete other Entry from Table."); + Assert.That(otherObj.IsDeleted, Is.True, "Test Table Auto Inc other Entry deleted Flag should be true."); + Assert.That(otherObj.IsPersisted, Is.False, "Test Table Auto Inc other Entry Persisted Flag should be false."); otherObj.PrimaryKey = default(int); var reInserted = Database.AddObject(otherObj); - Assert.IsTrue(reInserted, "Test Table Auto Inc could not insert other Entry in Table again."); + Assert.That(reInserted, Is.True, "Test Table Auto Inc could not insert other Entry in Table again."); - Assert.Greater(otherObj.PrimaryKey, otherAutoInc, "Re-Added Test Table Auto Inc Entry should have a Greater Primary Key Increment."); + Assert.That(otherObj.PrimaryKey, Is.GreaterThan(otherAutoInc), "Re-Added Test Table Auto Inc Entry should have a Greater Primary Key Increment."); // Try modifying to check that Primary Key is Used for Update Where Clause otherObj.TestField = "Test AutoInc Other Modified !"; - Assert.IsTrue(otherObj.Dirty, "Test Table Auto Inc Other Object should be Dirty after Modifications."); + Assert.That(otherObj.Dirty, Is.True, "Test Table Auto Inc Other Object should be Dirty after Modifications."); var modified = Database.SaveObject(otherObj); - Assert.IsTrue(modified, "Test Table Auto Inc Other Object could not be Modified."); - Assert.IsFalse(otherObj.Dirty, "Test Table Auto Inc Other Object should not be Dirty after save."); + Assert.That(modified, Is.True, "Test Table Auto Inc Other Object could not be Modified."); + Assert.That(otherObj.Dirty, Is.False, "Test Table Auto Inc Other Object should not be Dirty after save."); var retrieve = Database.FindObjectByKey(otherObj.PrimaryKey); - Assert.IsNotNull(retrieve, "Test Table Auto Inc Other Object could not be Retrieved through Primary Key."); - Assert.AreEqual(otherObj.TestField, retrieve.TestField, "Test Table Auto Inc Retrieved Object is different from Other Object."); + Assert.That(retrieve, Is.Not.Null, "Test Table Auto Inc Other Object could not be Retrieved through Primary Key."); + Assert.That(retrieve.TestField, Is.EqualTo(otherObj.TestField), "Test Table Auto Inc Retrieved Object is different from Other Object."); } /// @@ -203,28 +203,28 @@ public void TestTableUnique() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableUniqueField."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableUniqueField."); // Test Add var uniqueObj = new TestTableUniqueField { TestField = "Test Value Unique", Unique = 1 }; var inserted = Database.AddObject(uniqueObj); - Assert.IsTrue(inserted, "Test Table Unique Field could not insert unique object."); + Assert.That(inserted, Is.True, "Test Table Unique Field could not insert unique object."); // Try Adding with unique Value var otherUniqueObj = new TestTableUniqueField { TestField = "Test Value Other Unique", Unique = 1 }; var otherInserted = Database.AddObject(otherUniqueObj); - Assert.IsFalse(otherInserted, "Test Table Unique Field with Other Object violating unique constraint should not be inserted."); + Assert.That(otherInserted, Is.False, "Test Table Unique Field with Other Object violating unique constraint should not be inserted."); // Try Adding with non unique Value var otherNonUniqueObj = new TestTableUniqueField { TestField = "Test Value Other Non-Unique", Unique = 2 }; var nonUniqueInserted = Database.AddObject(otherNonUniqueObj); - Assert.IsTrue(nonUniqueInserted, "Test Table Unique Field with Other Non Unique Object could not be inserted"); + Assert.That(nonUniqueInserted, Is.True, "Test Table Unique Field with Other Non Unique Object could not be inserted"); // Try saving with unique Value var retrieved = Database.FindObjectByKey(otherNonUniqueObj.ObjectId); @@ -233,16 +233,16 @@ public void TestTableUnique() var saved = Database.SaveObject(retrieved); - Assert.IsFalse(saved, "Test Table Unique Field with Retrieved Object violating unique constraint should not be saved."); + Assert.That(saved, Is.False, "Test Table Unique Field with Retrieved Object violating unique constraint should not be saved."); // Delete Previous Unique and Try Reinsert. var deleted = Database.DeleteObject(uniqueObj); - Assert.IsTrue(deleted, "Test Table Unique Field could not delete unique object."); - Assert.IsTrue(uniqueObj.IsDeleted, "Test Table Unique Field unique object should have delete flag set."); + Assert.That(deleted, Is.True, "Test Table Unique Field could not delete unique object."); + Assert.That(uniqueObj.IsDeleted, Is.True, "Test Table Unique Field unique object should have delete flag set."); var retrievedSaved = Database.SaveObject(retrieved); - Assert.IsTrue(retrievedSaved, "Test Table Unique Field Retrieved Object could not be inserted after deleting previous constraint violating object."); + Assert.That(retrievedSaved, Is.True, "Test Table Unique Field Retrieved Object could not be inserted after deleting previous constraint violating object."); } /// @@ -261,27 +261,27 @@ public void TestTableMultiUnique() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableMultiUnique."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableMultiUnique."); // Test Add var uniqueObj = new TestTableMultiUnique { StrUniquePart = "Test Value Unique", IntUniquePart = 1 }; var inserted = Database.AddObject(uniqueObj); - Assert.IsTrue(inserted, "Test Table Unique Multiple Field could not insert unique object."); + Assert.That(inserted, Is.True, "Test Table Unique Multiple Field could not insert unique object."); // Try Adding with unique Value var otherUniqueObj = new TestTableMultiUnique { StrUniquePart = "Test Value Unique", IntUniquePart = 1 }; var otherInserted = Database.AddObject(otherUniqueObj); - Assert.IsFalse(otherInserted, "Test Table Unique Multiple Field with Other Object violating unique constraint should not be inserted."); + Assert.That(otherInserted, Is.False, "Test Table Unique Multiple Field with Other Object violating unique constraint should not be inserted."); // Try Adding with non unique Value var otherNonUniqueObj = new TestTableMultiUnique { StrUniquePart = "Test Value Other Non-Unique", IntUniquePart = 2 }; var nonUniqueInserted = Database.AddObject(otherNonUniqueObj); - Assert.IsTrue(nonUniqueInserted, "Test Table Unique Multiple Field with Other Non Unique Object could not be inserted"); + Assert.That(nonUniqueInserted, Is.True, "Test Table Unique Multiple Field with Other Non Unique Object could not be inserted"); // Try saving with unique Value var retrieved = Database.FindObjectByKey(otherNonUniqueObj.ObjectId); @@ -291,16 +291,16 @@ public void TestTableMultiUnique() var saved = Database.SaveObject(retrieved); - Assert.IsFalse(saved, "Test Table Unique Multiple Field with Retrieved Object violating unique constraint should not be saved."); + Assert.That(saved, Is.False, "Test Table Unique Multiple Field with Retrieved Object violating unique constraint should not be saved."); // Delete Previous Unique and Try Reinsert. var deleted = Database.DeleteObject(uniqueObj); - Assert.IsTrue(deleted, "Test Table Unique Field could not delete unique object."); - Assert.IsTrue(uniqueObj.IsDeleted, "Test Table Unique Field unique object should have delete flag set."); + Assert.That(deleted, Is.True, "Test Table Unique Field could not delete unique object."); + Assert.That(uniqueObj.IsDeleted, Is.True, "Test Table Unique Field unique object should have delete flag set."); var retrievedSaved = Database.SaveObject(retrieved); - Assert.IsTrue(retrievedSaved, "Test Table Unique Field Retrieved Object could not be inserted after deleting previous constraint violating object."); + Assert.That(retrievedSaved, Is.True, "Test Table Unique Field Retrieved Object could not be inserted after deleting previous constraint violating object."); } /// @@ -320,7 +320,7 @@ public void TestTableRelation() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableRelationEntry."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableRelationEntry."); var allrel = Database.SelectAllObjects(); @@ -329,66 +329,66 @@ public void TestTableRelation() var nonerel = Database.SelectAllObjects(); - Assert.IsEmpty(nonerel, "Database shouldn't have any record For TestTableRelation."); + Assert.That(nonerel, Is.Empty, "Database shouldn't have any record For TestTableRelation."); // Try Add with no Relation var noRelObj = new TestTableRelation() { TestField = "RelationTestValue" }; var inserted = Database.AddObject(noRelObj); - Assert.IsTrue(inserted, "Test Table Relation could not insert object with no relation."); - Assert.IsNull(noRelObj.Entry, "Test Table Relation object with no relation should have null Entry."); + Assert.That(inserted, Is.True, "Test Table Relation could not insert object with no relation."); + Assert.That(noRelObj.Entry, Is.Null, "Test Table Relation object with no relation should have null Entry."); // Try Select var selectInserted = Database.SelectAllObjects(); - CollectionAssert.IsNotEmpty(selectInserted, "Test Table Relation could not retrieve objects without relation."); + Assert.That(selectInserted, Is.Not.Empty, "Test Table Relation could not retrieve objects without relation."); // Try Adding Relation var relObj = new TestTableRelationEntry() { TestField = "RelationEntryTestValue", ObjectId = noRelObj.ObjectId }; var relInserted = Database.AddObject(relObj); - Assert.IsTrue(relInserted, "Test Table Relation Entry could not be inserted."); + Assert.That(relInserted, Is.True, "Test Table Relation Entry could not be inserted."); noRelObj.Entry = relObj; var saved = Database.SaveObject(noRelObj); - Assert.IsTrue(saved, "Test Table Relation could not save Object with a new relation Added."); + Assert.That(saved, Is.True, "Test Table Relation could not save Object with a new relation Added."); // Try Retrieving Relation var retrieve = Database.FindObjectByKey(noRelObj.ObjectId); - Assert.IsNotNull(retrieve, "Test Table Relation could not retrieve relation object by ObjectId."); - Assert.IsNotNull(retrieve.Entry, "Test Table Relation retrieved object have no entry object."); - Assert.AreEqual(relObj.TestField, retrieve.Entry.TestField, "Test Table Relation retrieved object Entry Relation is different from created object."); + Assert.That(retrieve, Is.Not.Null, "Test Table Relation could not retrieve relation object by ObjectId."); + Assert.That(retrieve.Entry, Is.Not.Null, "Test Table Relation retrieved object have no entry object."); + Assert.That(retrieve.Entry.TestField, Is.EqualTo(relObj.TestField), "Test Table Relation retrieved object Entry Relation is different from created object."); // Try Deleting Relation var deleted = Database.DeleteObject(noRelObj); - Assert.IsTrue(deleted, "Test Table Relation could not delete object with relation."); - Assert.IsTrue(noRelObj.IsDeleted, "Test Table Relation deleted object should have deleted flag set."); - Assert.IsTrue(noRelObj.Entry.IsDeleted, "Test Table Relation deleted object Entry should have deleted flag set."); + Assert.That(deleted, Is.True, "Test Table Relation could not delete object with relation."); + Assert.That(noRelObj.IsDeleted, Is.True, "Test Table Relation deleted object should have deleted flag set."); + Assert.That(noRelObj.Entry.IsDeleted, Is.True, "Test Table Relation deleted object Entry should have deleted flag set."); // Check that Relation was deleted var relRetrieve = Database.FindObjectByKey(relObj.ObjectId); - Assert.IsNull(relRetrieve, "Test Table Relation Entry was not auto deleted with relation object."); - Assert.IsTrue(relObj.IsDeleted, "Test Table Relation Entry should have deleted flag set after auto delete."); + Assert.That(relRetrieve, Is.Null, "Test Table Relation Entry was not auto deleted with relation object."); + Assert.That(relObj.IsDeleted, Is.True, "Test Table Relation Entry should have deleted flag set after auto delete."); // Check Null Relation var nullObj = new TestTableRelation() { TestField = "RelationNullTestValue" }; var nullAdded = Database.AddObject(nullObj); - Assert.IsTrue(nullAdded, "Test Table Relation need an object for the Null Relation Test."); + Assert.That(nullAdded, Is.True, "Test Table Relation need an object for the Null Relation Test."); nullObj.ObjectId = null; nullObj.Entry = new TestTableRelationEntry() { TestField = "RelationEntryNullTestValue" }; Database.FillObjectRelations(nullObj); - Assert.IsNull(nullObj.Entry, "Test Table Relation should not have entry with null local value."); + Assert.That(nullObj.Entry, Is.Null, "Test Table Relation should not have entry with null local value."); // Check Allow Add Restriction var allowAddRestriction = new TestTableRelation() { TestField = "RelationTestValueAllowAddRestriction" }; @@ -397,33 +397,33 @@ public void TestTableRelation() var restrictionAdded = Database.AddObject(allowAddRestriction); - Assert.IsFalse(restrictionAdded, "Test Table Relation should return error when relation failed saving."); - Assert.IsTrue(allowAddRestriction.IsPersisted, "Test Table Relation should be persisted in database."); - Assert.IsFalse(allowAddRestriction.Entry.IsPersisted, "Test Table Relation Entry should not be persisted if AllowAdd Restriction is in place."); + Assert.That(restrictionAdded, Is.False, "Test Table Relation should return error when relation failed saving."); + Assert.That(allowAddRestriction.IsPersisted, Is.True, "Test Table Relation should be persisted in database."); + Assert.That(allowAddRestriction.Entry.IsPersisted, Is.False, "Test Table Relation Entry should not be persisted if AllowAdd Restriction is in place."); // Check Dirty Restriction allowAddRestriction.Entry.AllowAdd = true; var restrictionSaved = Database.SaveObject(allowAddRestriction); - Assert.IsTrue(restrictionSaved, "Test Table Relation restriction test should have the restricted object seved to database."); - Assert.IsTrue(allowAddRestriction.Entry.IsPersisted, "Test Table Relation Entry restriction test should be persisted."); + Assert.That(restrictionSaved, Is.True, "Test Table Relation restriction test should have the restricted object seved to database."); + Assert.That(allowAddRestriction.Entry.IsPersisted, Is.True, "Test Table Relation Entry restriction test should be persisted."); - Assert.IsFalse(allowAddRestriction.Dirty, "Test Table Relation restriction object should not have Dirty flag after saving."); + Assert.That(allowAddRestriction.Dirty, Is.False, "Test Table Relation restriction object should not have Dirty flag after saving."); var modifiedText = "RelationEntryTestValueAllowAddRestrictionModified"; allowAddRestriction.Entry.TestField = modifiedText; allowAddRestriction.Entry.Dirty = false; - Assert.IsFalse(allowAddRestriction.Entry.Dirty, "Test Table Relation Entry need to have its Dirty flag off for this Test."); + Assert.That(allowAddRestriction.Entry.Dirty, Is.False, "Test Table Relation Entry need to have its Dirty flag off for this Test."); var modifySaved = Database.SaveObject(allowAddRestriction); - Assert.IsTrue(modifySaved, "Test Table Relation should be saved correctly with Dirty flag off."); + Assert.That(modifySaved, Is.True, "Test Table Relation should be saved correctly with Dirty flag off."); Database.FillObjectRelations(allowAddRestriction); - Assert.AreNotEqual(modifiedText, allowAddRestriction.Entry.TestField, "Test Table Relation Entry should not have been saved with modified text."); + Assert.That(allowAddRestriction.Entry.TestField, Is.Not.EqualTo(modifiedText), "Test Table Relation Entry should not have been saved with modified text."); // Check Allow Delete Restriction var restrictionEntry = allowAddRestriction.Entry; @@ -431,10 +431,10 @@ public void TestTableRelation() var restrictionDeleted = Database.DeleteObject(allowAddRestriction); - Assert.IsFalse(restrictionDeleted, "Test Table Relation should not be deleted correctly."); - Assert.IsTrue(restrictionEntry.IsPersisted, "Test Table Relation Entry should still be Persisted."); - Assert.IsFalse(restrictionEntry.IsDeleted, "Test Table Relation Entry should not be deleted."); - Assert.IsFalse(allowAddRestriction.IsPersisted, "Test Table Relation object should not be persisted."); + Assert.That(restrictionDeleted, Is.False, "Test Table Relation should not be deleted correctly."); + Assert.That(restrictionEntry.IsPersisted, Is.True, "Test Table Relation Entry should still be Persisted."); + Assert.That(restrictionEntry.IsDeleted, Is.False, "Test Table Relation Entry should not be deleted."); + Assert.That(allowAddRestriction.IsPersisted, Is.False, "Test Table Relation object should not be persisted."); } /// @@ -454,7 +454,7 @@ public void TestTableRelations() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableRelationsEntries."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableRelationsEntries."); var allrel = Database.SelectAllObjects(); @@ -463,19 +463,19 @@ public void TestTableRelations() var nonerel = Database.SelectAllObjects(); - Assert.IsEmpty(nonerel, "Database shouldn't have any record For TestTableRelations."); + Assert.That(nonerel, Is.Empty, "Database shouldn't have any record For TestTableRelations."); // Try Add With no Relation var noRelObj = new TestTableRelations() { TestField = "RelationsTestValue" }; var inserted = Database.AddObject(noRelObj); - Assert.IsTrue(inserted, "Test Table Relations could not insert object with no relation."); - Assert.IsNull(noRelObj.Entries, "Test Table Relations object with no relation should have null Entry."); + Assert.That(inserted, Is.True, "Test Table Relations could not insert object with no relation."); + Assert.That(noRelObj.Entries, Is.Null, "Test Table Relations object with no relation should have null Entry."); // Try Selecting var selectInserted = Database.SelectAllObjects(); - CollectionAssert.IsNotEmpty(selectInserted, "Test Table Relations could not retrieve objects without relation."); + Assert.That(selectInserted, Is.Not.Empty, "Test Table Relations could not retrieve objects without relation."); // Try Adding Relation var testValues = new[] { "RelationsEntriesTestValue 1", "RelationsEntriesTestValue 2", "RelationsEntriesTestValue 3" }; @@ -484,48 +484,48 @@ public void TestTableRelations() var relInserted = relObjs.Select(o => Database.AddObject(o)).ToArray(); - Assert.IsTrue(relInserted.All(res => res), "Test Table Relations Entries could not be inserted."); + Assert.That(relInserted.All(res => res), Is.True, "Test Table Relations Entries could not be inserted."); noRelObj.Entries = relObjs; var saved = Database.SaveObject(noRelObj); - Assert.IsTrue(saved, "Test Table Relations could not save Object with a new relations Added."); + Assert.That(saved, Is.True, "Test Table Relations could not save Object with a new relations Added."); // Try Retrieving Relation var retrieve = Database.FindObjectByKey(noRelObj.ObjectId); - Assert.IsNotNull(retrieve, "Test Table Relations could not retrieve relations object by ObjectId."); - Assert.IsNotNull(retrieve.Entries, "Test Table Relations retrieved object have no entries objects."); - CollectionAssert.AreEquivalent(testValues, retrieve.Entries.Select(o => o.TestField), + Assert.That(retrieve, Is.Not.Null, "Test Table Relations could not retrieve relations object by ObjectId."); + Assert.That(retrieve.Entries, Is.Not.Null, "Test Table Relations retrieved object have no entries objects."); + Assert.That(retrieve.Entries.Select(o => o.TestField), Is.EquivalentTo(testValues), "Test Table Relations retrieved objects Entries Relation are different from created objects."); // Try Deleting Relation var deleted = Database.DeleteObject(noRelObj); - Assert.IsTrue(deleted, "Test Table Relations could not delete object with relations."); - Assert.IsTrue(noRelObj.IsDeleted, "Test Table Relations deleted object should have deleted flag set."); - Assert.IsTrue(noRelObj.Entries.All(ent => ent.IsDeleted), "Test Table Relations deleted object should have all Entries with deleted flag set."); + Assert.That(deleted, Is.True, "Test Table Relations could not delete object with relations."); + Assert.That(noRelObj.IsDeleted, Is.True, "Test Table Relations deleted object should have deleted flag set."); + Assert.That(noRelObj.Entries.All(ent => ent.IsDeleted), Is.True, "Test Table Relations deleted object should have all Entries with deleted flag set."); // Check that Relation was deleted var relRetrieve = Database.SelectAllObjects().Where(o => o.ForeignTestField == noRelObj.ObjectId); - Assert.IsEmpty(relRetrieve, "Test Table Relations Entries were not auto deleted with relations object."); - Assert.IsTrue(relObjs.All(o => o.IsDeleted), "Test Table Relations Entries should have deleted flags set after auto delete."); + Assert.That(relRetrieve, Is.Empty, "Test Table Relations Entries were not auto deleted with relations object."); + Assert.That(relObjs.All(o => o.IsDeleted), Is.True, "Test Table Relations Entries should have deleted flags set after auto delete."); // Check Null Relation var nullObj = new TestTableRelations() { TestField = "RelationsNullTestValue" }; var nullAdded = Database.AddObject(nullObj); - Assert.IsTrue(nullAdded, "Test Table Relations need an object for the Null Relation Test."); + Assert.That(nullAdded, Is.True, "Test Table Relations need an object for the Null Relation Test."); nullObj.ObjectId = null; nullObj.Entries = Array.Empty(); Database.FillObjectRelations(nullObj); - Assert.IsNull(nullObj.Entries, "Test Table Relations should have null entries with null local value."); + Assert.That(nullObj.Entries, Is.Null, "Test Table Relations should have null entries with null local value."); // Check Allow Add Restriction var allowAddRestriction = new TestTableRelations() { TestField = "RelationTestValueAllowAddRestriction" }; @@ -534,34 +534,34 @@ public void TestTableRelations() var restrictionAdded = Database.AddObject(allowAddRestriction); - Assert.IsFalse(restrictionAdded, "Test Table Relations should return false when missing relation adding."); - Assert.IsTrue(allowAddRestriction.IsPersisted, "Test Table Relations should be persisted."); + Assert.That(restrictionAdded, Is.False, "Test Table Relations should return false when missing relation adding."); + Assert.That(allowAddRestriction.IsPersisted, Is.True, "Test Table Relations should be persisted."); - Assert.IsFalse(allowAddRestriction.Entries[0].IsPersisted, "Test Table Relations Entries should not be persisted if AllowAdd Restriction is in place."); + Assert.That(allowAddRestriction.Entries[0].IsPersisted, Is.False, "Test Table Relations Entries should not be persisted if AllowAdd Restriction is in place."); // Check Dirty Restriction allowAddRestriction.Entries[0].AllowAdd = true; var restrictionSaved = Database.SaveObject(allowAddRestriction); - Assert.IsTrue(restrictionSaved, "Test Table Relations restriction test should have the restricted object seved to database."); - Assert.IsTrue(allowAddRestriction.Entries[0].IsPersisted, "Test Table Relations Entries restriction test should be persisted."); + Assert.That(restrictionSaved, Is.True, "Test Table Relations restriction test should have the restricted object seved to database."); + Assert.That(allowAddRestriction.Entries[0].IsPersisted, Is.True, "Test Table Relations Entries restriction test should be persisted."); - Assert.IsFalse(allowAddRestriction.Dirty, "Test Table Relations restriction object should not have Dirty flag after saving."); + Assert.That(allowAddRestriction.Dirty, Is.False, "Test Table Relations restriction object should not have Dirty flag after saving."); var modifiedText = "RelationEntryTestValueAllowAddRestrictionModified"; allowAddRestriction.Entries[0].TestField = modifiedText; allowAddRestriction.Entries[0].Dirty = false; - Assert.IsFalse(allowAddRestriction.Entries[0].Dirty, "Test Table Relations Entries need to have its Dirty flag off for this Test."); + Assert.That(allowAddRestriction.Entries[0].Dirty, Is.False, "Test Table Relations Entries need to have its Dirty flag off for this Test."); var modifySaved = Database.SaveObject(allowAddRestriction); - Assert.IsTrue(modifySaved, "Test Table Relations should be saved correctly with Dirty flag off."); + Assert.That(modifySaved, Is.True, "Test Table Relations should be saved correctly with Dirty flag off."); Database.FillObjectRelations(allowAddRestriction); - Assert.AreNotEqual(modifiedText, allowAddRestriction.Entries[0].TestField, "Test Table Relations Entries should not have been saved with modified text."); + Assert.That(allowAddRestriction.Entries[0].TestField, Is.Not.EqualTo(modifiedText), "Test Table Relations Entries should not have been saved with modified text."); // Check Allow Delete Restriction var restrictionEntry = allowAddRestriction.Entries[0]; @@ -569,10 +569,10 @@ public void TestTableRelations() var restrictionDeleted = Database.DeleteObject(allowAddRestriction); - Assert.IsFalse(restrictionDeleted, "Test Table Relations should not be deleted correctly."); - Assert.IsTrue(restrictionEntry.IsPersisted, "Test Table Relations Entries should still be Persisted."); - Assert.IsFalse(restrictionEntry.IsDeleted, "Test Table Relations Entries should not be deleted."); - Assert.IsFalse(allowAddRestriction.IsPersisted, "Test Table Relations object should not be persisted."); + Assert.That(restrictionDeleted, Is.False, "Test Table Relations should not be deleted correctly."); + Assert.That(restrictionEntry.IsPersisted, Is.True, "Test Table Relations Entries should still be Persisted."); + Assert.That(restrictionEntry.IsDeleted, Is.False, "Test Table Relations Entries should not be deleted."); + Assert.That(allowAddRestriction.IsPersisted, Is.False, "Test Table Relations object should not be persisted."); } /// @@ -591,7 +591,7 @@ public void TestTableRelationsNoAutoload() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableRelationsEntries."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableRelationsEntries."); var allrel = Database.SelectAllObjects(); @@ -599,15 +599,15 @@ public void TestTableRelationsNoAutoload() var nonerel = Database.SelectAllObjects(); - Assert.IsEmpty(nonerel, "Database shouldn't have any record For TestTableRelationsWithNoAutoLoad."); + Assert.That(nonerel, Is.Empty, "Database shouldn't have any record For TestTableRelationsWithNoAutoLoad."); // Try Add With no Relation var noRelObj = new TestTableRelationsWithNoAutoLoad() { TestField = "RelationsTestValue" }; var inserted = Database.AddObject(noRelObj); - Assert.IsTrue(inserted, "Test Table Relations (NoAutoLoad) could not insert object with no relation."); - Assert.IsNull(noRelObj.Entries, "Test Table Relations (NoAutoLoad) object with no relation should have null Entry."); + Assert.That(inserted, Is.True, "Test Table Relations (NoAutoLoad) could not insert object with no relation."); + Assert.That(noRelObj.Entries, Is.Null, "Test Table Relations (NoAutoLoad) object with no relation should have null Entry."); // Try Adding Relation var testValues = new[] { "RelationsEntriesTestValue 1", "RelationsEntriesTestValue 2", "RelationsEntriesTestValue 3" }; @@ -616,24 +616,24 @@ public void TestTableRelationsNoAutoload() var relInserted = Database.AddObject(relObjs); - Assert.IsTrue(relInserted, "Test Table Relations Entries could not be inserted."); + Assert.That(relInserted, Is.True, "Test Table Relations Entries could not be inserted."); noRelObj.Entries = relObjs; var saved = Database.SaveObject(noRelObj); - Assert.IsTrue(saved, "Test Table Relations (NoAutoLoad) could not save Object with a new relations Added."); + Assert.That(saved, Is.True, "Test Table Relations (NoAutoLoad) could not save Object with a new relations Added."); // Try Retrieving Relation var retrieve = Database.FindObjectByKey(noRelObj.ObjectId); - Assert.IsNotNull(retrieve, "Test Table Relations (NoAutoLoad) could not retrieve relations object by ObjectId."); - Assert.IsNull(retrieve.Entries, "Test Table Relations (NoAutoLoad) retrieved object should not have entries objects."); + Assert.That(retrieve, Is.Not.Null, "Test Table Relations (NoAutoLoad) could not retrieve relations object by ObjectId."); + Assert.That(retrieve.Entries, Is.Null, "Test Table Relations (NoAutoLoad) retrieved object should not have entries objects."); Database.FillObjectRelations(retrieve); - Assert.IsNotNull(retrieve.Entries, "Test Table Relations (NoAutoLoad) retrieved object should have entries objects after filling."); + Assert.That(retrieve.Entries, Is.Not.Null, "Test Table Relations (NoAutoLoad) retrieved object should have entries objects after filling."); - CollectionAssert.AreEquivalent(testValues, retrieve.Entries.Select(o => o.TestField), + Assert.That(retrieve.Entries.Select(o => o.TestField), Is.EquivalentTo(testValues), "Test Table Relations (NoAutoLoad) retrieved objects Entries Relation are different from created objects."); var changedRel = Database.FindObjectByKey(retrieve.Entries[0].ObjectId); @@ -642,25 +642,25 @@ public void TestTableRelationsNoAutoload() var resaved = Database.SaveObject(changedRel); - Assert.IsTrue(resaved, "Changed Relation (NoAutoLoad) could not be saved to database..."); + Assert.That(resaved, Is.True, "Changed Relation (NoAutoLoad) could not be saved to database..."); var newTestValues = new[] { changedRel.TestField, retrieve.Entries[1].TestField, retrieve.Entries[2].TestField }; Database.FillObjectRelations(retrieve); - CollectionAssert.AreEquivalent(newTestValues, retrieve.Entries.Select(obj => obj.TestField), "Test Table Relations (NoAutoLoad) refreshed objects Entries Relation are different from changed objects."); + Assert.That(retrieve.Entries.Select(obj => obj.TestField), Is.EquivalentTo(newTestValues), "Test Table Relations (NoAutoLoad) refreshed objects Entries Relation are different from changed objects."); // Try Deleting Relation var deleted = Database.DeleteObject(noRelObj); - Assert.IsTrue(deleted, "Test Table Relations (NoAutoLoad) could not delete object with relations."); - Assert.IsTrue(noRelObj.IsDeleted, "Test Table Relations (NoAutoLoad) deleted object should have deleted flag set."); + Assert.That(deleted, Is.True, "Test Table Relations (NoAutoLoad) could not delete object with relations."); + Assert.That(noRelObj.IsDeleted, Is.True, "Test Table Relations (NoAutoLoad) deleted object should have deleted flag set."); // Check that Relations were deleted var relRetrieve = Database.SelectAllObjects().Where(o => o.ForeignTestField == noRelObj.ObjectId); - Assert.IsEmpty(relRetrieve, "Test Table Relations (NoAutoLoad) Entries were not auto deleted with relations object."); - Assert.IsTrue(relObjs.All(o => o.IsDeleted), "Test Table Relations (NoAutoLoad) Entries should have deleted flags set after auto delete."); + Assert.That(relRetrieve, Is.Empty, "Test Table Relations (NoAutoLoad) Entries were not auto deleted with relations object."); + Assert.That(relObjs.All(o => o.IsDeleted), Is.True, "Test Table Relations (NoAutoLoad) Entries should have deleted flags set after auto delete."); } /// @@ -679,7 +679,7 @@ public void TestTableRelationsWithNoAutoDelete() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableRelationsEntries."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableRelationsEntries."); var allrel = Database.SelectAllObjects(); @@ -687,7 +687,7 @@ public void TestTableRelationsWithNoAutoDelete() var nonerel = Database.SelectAllObjects(); - Assert.IsEmpty(nonerel, "Database shouldn't have any record For TestTableRelationsWithNoAutoDelete."); + Assert.That(nonerel, Is.Empty, "Database shouldn't have any record For TestTableRelationsWithNoAutoDelete."); // Add Relation Object var relObj = new TestTableRelationsWithNoAutoDelete() { TestField = "RelationsTestValue NoAutoDelete" }; @@ -697,27 +697,27 @@ public void TestTableRelationsWithNoAutoDelete() var inserted = Database.AddObject(relObj); - Assert.IsTrue(inserted, "Test Table Relations (NoAutoDelete) could not insert object with no relation."); + Assert.That(inserted, Is.True, "Test Table Relations (NoAutoDelete) could not insert object with no relation."); // Try Retrieving Relation var retrieve = Database.FindObjectByKey(relObj.ObjectId); - Assert.IsNotNull(retrieve, "Test Table Relations (NoAutoDelete) could not retrieve relations object by ObjectId."); - Assert.IsNotEmpty(retrieve.Entries, "Test Table Relations (NoAutoDelete) retrieved object should have entries objects."); - CollectionAssert.AreEquivalent(testValues, retrieve.Entries.Select(obj => obj.TestField), "Test Table Relations (NoAutoDelete) retrieved object Entries should have same values as created."); + Assert.That(retrieve, Is.Not.Null, "Test Table Relations (NoAutoDelete) could not retrieve relations object by ObjectId."); + Assert.That(retrieve.Entries, Is.Not.Empty, "Test Table Relations (NoAutoDelete) retrieved object should have entries objects."); + Assert.That(retrieve.Entries.Select(obj => obj.TestField), Is.EquivalentTo(testValues), "Test Table Relations (NoAutoDelete) retrieved object Entries should have same values as created."); // Try Deleting Relation var deleted = Database.DeleteObject(relObj); - Assert.IsTrue(deleted, "Test Table Relations (NoAutoDelete) could not delete object with relations."); - Assert.IsTrue(relObj.IsDeleted, "Test Table Relations (NoAutoDelete) deleted object should have deleted flag set."); + Assert.That(deleted, Is.True, "Test Table Relations (NoAutoDelete) could not delete object with relations."); + Assert.That(relObj.IsDeleted, Is.True, "Test Table Relations (NoAutoDelete) deleted object should have deleted flag set."); // Check that Relation were not deleted var relRetrieve = Database.SelectAllObjects().Where(o => o.ForeignTestField == relObj.ObjectId); - Assert.IsNotEmpty(relRetrieve, "Test Table Relations (NoAutoDelete) Entries should not be auto deleted with relations object."); - Assert.IsTrue(relObj.Entries.All(o => !o.IsDeleted), "Test Table Relations (NoAutoDelete) Entries should not have deleted flags set after delete."); - CollectionAssert.AreEquivalent(testValues, relRetrieve.Select(obj => obj.TestField), "Test Table Relations (NoAutoDelete) Entries should have the same element as created."); + Assert.That(relRetrieve, Is.Not.Empty, "Test Table Relations (NoAutoDelete) Entries should not be auto deleted with relations object."); + Assert.That(relObj.Entries.All(o => !o.IsDeleted), Is.True, "Test Table Relations (NoAutoDelete) Entries should not have deleted flags set after delete."); + Assert.That(relRetrieve.Select(obj => obj.TestField), Is.EquivalentTo(testValues), "Test Table Relations (NoAutoDelete) Entries should have the same element as created."); } /// @@ -736,28 +736,28 @@ public void TestTablePrimaryKey() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableUniqueField."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableUniqueField."); // Test Add var uniqueObj = new TestTablePrimaryKey { TestField = "Test Value", PrimaryKey = "Key1" }; var inserted = Database.AddObject(uniqueObj); - Assert.IsTrue(inserted, "Test Table Primary Key could not insert unique key object."); + Assert.That(inserted, Is.True, "Test Table Primary Key could not insert unique key object."); // Try Adding with unique Value var otherUniqueObj = new TestTablePrimaryKey { TestField = "Test Value Other", PrimaryKey = "Key1" }; var otherInserted = Database.AddObject(otherUniqueObj); - Assert.IsFalse(otherInserted, "Test Table Primary Key with Other Object violating key constraint should not be inserted."); + Assert.That(otherInserted, Is.False, "Test Table Primary Key with Other Object violating key constraint should not be inserted."); // Try Adding with non unique Value var otherNonUniqueObj = new TestTablePrimaryKey { TestField = "Test Value Other Non-Primary", PrimaryKey = "Key2" }; var nonUniqueInserted = Database.AddObject(otherNonUniqueObj); - Assert.IsTrue(nonUniqueInserted, "Test Table Primary Key with Other Non Unique Key could not be inserted"); + Assert.That(nonUniqueInserted, Is.True, "Test Table Primary Key with Other Non Unique Key could not be inserted"); // Try saving with unique Value var retrieved = Database.FindObjectByKey(otherNonUniqueObj.PrimaryKey); @@ -767,16 +767,16 @@ public void TestTablePrimaryKey() var saved = Database.SaveObject(retrieved); - Assert.IsFalse(saved, "Test Table Primary Key with Retrieved Object violating key constraint should not be saved."); + Assert.That(saved, Is.False, "Test Table Primary Key with Retrieved Object violating key constraint should not be saved."); // Delete Previous Unique and Try Reinsert. var deleted = Database.DeleteObject(uniqueObj); - Assert.IsTrue(deleted, "Test Table Primary Key could not delete unique key object."); - Assert.IsTrue(uniqueObj.IsDeleted, "Test Table Primary Key unique key object should have delete flag set."); + Assert.That(deleted, Is.True, "Test Table Primary Key could not delete unique key object."); + Assert.That(uniqueObj.IsDeleted, Is.True, "Test Table Primary Key unique key object should have delete flag set."); var retrievedSaved = Database.SaveObject(retrieved); - Assert.IsTrue(retrievedSaved, "Test Table Primary Key Retrieved Object could not be inserted after deleting previous constraint violating object."); + Assert.That(retrievedSaved, Is.True, "Test Table Primary Key Retrieved Object could not be inserted after deleting previous constraint violating object."); } /// @@ -794,28 +794,28 @@ public void TestTablePrimaryKeyWithUnique() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTablePrimaryKeyUnique."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTablePrimaryKeyUnique."); // Test Add var uniqueObj = new TestTablePrimaryKeyUnique { TestField = "Test Value", PrimaryKey = "Key1", Unique = "Unique" }; var inserted = Database.AddObject(uniqueObj); - Assert.IsTrue(inserted, "Test Table Primary Key With Unique could not insert unique key object."); + Assert.That(inserted, Is.True, "Test Table Primary Key With Unique could not insert unique key object."); // Try Adding with unique Value var otherUniqueObj = new TestTablePrimaryKeyUnique { TestField = "Test Value Other", PrimaryKey = "Key1", Unique = "Unique" }; var otherInserted = Database.AddObject(otherUniqueObj); - Assert.IsFalse(otherInserted, "Test Table Primary Key With Unique with Other Object violating key constraint should not be inserted."); + Assert.That(otherInserted, Is.False, "Test Table Primary Key With Unique with Other Object violating key constraint should not be inserted."); // Try Adding with non unique Value var otherNonUniqueObj = new TestTablePrimaryKeyUnique { TestField = "Test Value Other Non-Primary", PrimaryKey = "Key2", Unique = "NonUnique" }; var nonUniqueInserted = Database.AddObject(otherNonUniqueObj); - Assert.IsTrue(nonUniqueInserted, "Test Table Primary Key With Unique with Other Non Unique Key could not be inserted"); + Assert.That(nonUniqueInserted, Is.True, "Test Table Primary Key With Unique with Other Non Unique Key could not be inserted"); // Try saving with unique Value var retrieved = Database.FindObjectByKey(otherNonUniqueObj.PrimaryKey); @@ -824,16 +824,16 @@ public void TestTablePrimaryKeyWithUnique() var saved = Database.SaveObject(retrieved); - Assert.IsFalse(saved, "Test Table Primary Key With Unique with Retrieved Object violating key constraint should not be saved."); + Assert.That(saved, Is.False, "Test Table Primary Key With Unique with Retrieved Object violating key constraint should not be saved."); // Delete Previous Unique and Try Reinsert. var deleted = Database.DeleteObject(uniqueObj); - Assert.IsTrue(deleted, "Test Table Primary Key With Unique could not delete unique key object."); - Assert.IsTrue(uniqueObj.IsDeleted, "Test Table Primary Key With Unique unique key object should have delete flag set."); + Assert.That(deleted, Is.True, "Test Table Primary Key With Unique could not delete unique key object."); + Assert.That(uniqueObj.IsDeleted, Is.True, "Test Table Primary Key With Unique unique key object should have delete flag set."); var retrievedSaved = Database.SaveObject(retrieved); - Assert.IsTrue(retrievedSaved, "Test Table Primary Key With Unique Retrieved Object could not be inserted after deleting previous constraint violating object."); + Assert.That(retrievedSaved, Is.True, "Test Table Primary Key With Unique Retrieved Object could not be inserted after deleting previous constraint violating object."); } /// @@ -851,30 +851,30 @@ public void TestTableWithReadOnly() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableWithReadOnly."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableWithReadOnly."); var testObj = new TestTableWithReadOnly { TestField = "Test For Read Only", ReadOnly = "ReadOnly Value" }; var inserted = Database.AddObject(testObj); - Assert.IsTrue(inserted, "Test Table With Readonly couldn't insert object in database."); + Assert.That(inserted, Is.True, "Test Table With Readonly couldn't insert object in database."); // Edit Readonly testObj.TestField = "Changed Test For Read Only"; testObj.ReadOnly = "ReadOnly Value !!CHANGED!!"; - Assert.IsTrue(testObj.Dirty, "Test Table With Readonly should set Dirty Flag when changing TestField."); + Assert.That(testObj.Dirty, Is.True, "Test Table With Readonly should set Dirty Flag when changing TestField."); var saved = Database.SaveObject(testObj); - Assert.IsTrue(saved, "Test Table With Readonly couldn't save object in database."); - Assert.IsFalse(testObj.Dirty, "Test Table With Readonly should no have Dirty Flag when saved."); + Assert.That(saved, Is.True, "Test Table With Readonly couldn't save object in database."); + Assert.That(testObj.Dirty, Is.False, "Test Table With Readonly should no have Dirty Flag when saved."); // Retrieve var retrieved = Database.FindObjectByKey(testObj.ObjectId); - Assert.IsNotNull(retrieved, "Test Table With Readonly couldn't retrieve object in database."); - Assert.AreNotEqual(testObj.ReadOnly, retrieved.ReadOnly, "Test Table With ReadOnly shouldn't have saved ReadOnly Field Change."); - Assert.AreEqual(testObj.TestField, retrieved.TestField, "Test Table With ReadOnly should have saved Test Field Change."); - Assert.AreEqual("ReadOnly Value", retrieved.ReadOnly, "Test Table With ReadOnly should have the same ReadOnly Field Value as Created."); + Assert.That(retrieved, Is.Not.Null, "Test Table With Readonly couldn't retrieve object in database."); + Assert.That(retrieved.ReadOnly, Is.Not.EqualTo(testObj.ReadOnly), "Test Table With ReadOnly shouldn't have saved ReadOnly Field Change."); + Assert.That(retrieved.TestField, Is.EqualTo(testObj.TestField), "Test Table With ReadOnly should have saved Test Field Change."); + Assert.That(retrieved.ReadOnly, Is.EqualTo("ReadOnly Value"), "Test Table With ReadOnly should have the same ReadOnly Field Value as Created."); } /// @@ -892,68 +892,68 @@ public void TestTableWithView() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableBaseView."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableBaseView."); // Insert some Object in Base View var objBase = new TestTableBaseView { TestField = "TestField for Base View", ViewValue = "This is a Value to be retrieve in View..." }; var inserted = Database.AddObject(objBase); - Assert.IsTrue(inserted, "Test Table With View could not insert object in database."); + Assert.That(inserted, Is.True, "Test Table With View could not insert object in database."); // Retrieve From View var retrieve = Database.SelectAllObjects().FirstOrDefault(); - Assert.IsNotNull(retrieve, "Test Table With View could not retrieve inserted Object from view ."); - Assert.AreEqual(objBase.PrimaryKey, retrieve.PrimaryKey, "Test Table With View should retrieve same value from Base and View Object."); - Assert.AreEqual(objBase.TestField, retrieve.TestField, "Test Table With View should retrieve same value from Base and View Object."); - Assert.AreEqual(objBase.ViewValue, retrieve.ViewValue, "Test Table With View should retrieve same value from Base and View Object."); - Assert.AreEqual("Weird Indeed", retrieve.WeirdValue, "Test Table With View should retrieve View Object with 'Weird Value' set as expected from ViewAs."); + Assert.That(retrieve, Is.Not.Null, "Test Table With View could not retrieve inserted Object from view ."); + Assert.That(retrieve.PrimaryKey, Is.EqualTo(objBase.PrimaryKey), "Test Table With View should retrieve same value from Base and View Object."); + Assert.That(retrieve.TestField, Is.EqualTo(objBase.TestField), "Test Table With View should retrieve same value from Base and View Object."); + Assert.That(retrieve.ViewValue, Is.EqualTo(objBase.ViewValue), "Test Table With View should retrieve same value from Base and View Object."); + Assert.That(retrieve.WeirdValue, Is.EqualTo("Weird Indeed"), "Test Table With View should retrieve View Object with 'Weird Value' set as expected from ViewAs."); // Try Add View Value var objView = new TestTableAsView { TestField = "TestField for As View", ViewValue = "This is a Value to saved in Base...", WeirdValue = "Anything..." }; var viewInsert = Database.AddObject(objView); - Assert.IsTrue(viewInsert, "Test Table With View should be able to Insert View Object as Base Object in Database."); + Assert.That(viewInsert, Is.True, "Test Table With View should be able to Insert View Object as Base Object in Database."); // Retrieve from Base var baseRetrieve = Database.FindObjectByKey(objView.PrimaryKey); - Assert.IsNotNull(baseRetrieve, "Test Table With View should be able to retrieve object from View Key."); - Assert.AreEqual(objView.PrimaryKey, baseRetrieve.PrimaryKey, "Test Table With View should retrieve same value from View and Base Object."); - Assert.AreEqual(objView.TestField, baseRetrieve.TestField, "Test Table With View should retrieve same value from View and Base Object."); - Assert.AreEqual(objView.ViewValue, baseRetrieve.ViewValue, "Test Table With View should retrieve same value from View and Base Object."); + Assert.That(baseRetrieve, Is.Not.Null, "Test Table With View should be able to retrieve object from View Key."); + Assert.That(baseRetrieve.PrimaryKey, Is.EqualTo(objView.PrimaryKey), "Test Table With View should retrieve same value from View and Base Object."); + Assert.That(baseRetrieve.TestField, Is.EqualTo(objView.TestField), "Test Table With View should retrieve same value from View and Base Object."); + Assert.That(baseRetrieve.ViewValue, Is.EqualTo(objView.ViewValue), "Test Table With View should retrieve same value from View and Base Object."); // Try Save Modified View Value var viewRetrieve = Database.FindObjectByKey(objView.PrimaryKey); - Assert.IsNotNull(viewRetrieve, "Test Table With View should be able to retrieve object from View Key."); + Assert.That(viewRetrieve, Is.Not.Null, "Test Table With View should be able to retrieve object from View Key."); viewRetrieve.TestField = "Changed TestField for As View"; viewRetrieve.ViewValue = "Changed Value to be saved in Base..."; var saved = Database.SaveObject(viewRetrieve); - Assert.IsTrue(saved, "Test Table With View should be able to Save View Object as Base Object in Database."); - Assert.IsFalse(viewRetrieve.Dirty, "Test Table With View should not have Dirty Flag on View Object Saved."); + Assert.That(saved, Is.True, "Test Table With View should be able to Save View Object as Base Object in Database."); + Assert.That(viewRetrieve.Dirty, Is.False, "Test Table With View should not have Dirty Flag on View Object Saved."); // Retrieve Saved var saveRetrieve = Database.FindObjectByKey(viewRetrieve.PrimaryKey); - Assert.IsNotNull(saveRetrieve, "Test Table With View should be able to retrieve object from Base Key."); - Assert.AreEqual(viewRetrieve.PrimaryKey, saveRetrieve.PrimaryKey, "Test Table With View should retrieve same value from View and Base Object."); - Assert.AreEqual(viewRetrieve.TestField, saveRetrieve.TestField, "Test Table With View should retrieve same value from View and Base Object."); - Assert.AreEqual(viewRetrieve.ViewValue, saveRetrieve.ViewValue, "Test Table With View should retrieve same value from View and Base Object."); + Assert.That(saveRetrieve, Is.Not.Null, "Test Table With View should be able to retrieve object from Base Key."); + Assert.That(saveRetrieve.PrimaryKey, Is.EqualTo(viewRetrieve.PrimaryKey), "Test Table With View should retrieve same value from View and Base Object."); + Assert.That(saveRetrieve.TestField, Is.EqualTo(viewRetrieve.TestField), "Test Table With View should retrieve same value from View and Base Object."); + Assert.That(saveRetrieve.ViewValue, Is.EqualTo(viewRetrieve.ViewValue), "Test Table With View should retrieve same value from View and Base Object."); // Try Filter Match (HIDDEN) var objHidden = new TestTableBaseView { TestField = "TestField for HIDDEN Base View", ViewValue = "HIDDEN" }; var savedHidden = Database.AddObject(objHidden); - Assert.IsTrue(savedHidden, "Test Table With View could not insert object in database."); + Assert.That(savedHidden, Is.True, "Test Table With View could not insert object in database."); var retrieveHidden = Database.FindObjectByKey(objHidden.PrimaryKey); - Assert.IsNull(retrieveHidden, "Test Table With View should not be able to retrieve object filtered out of View As Query."); + Assert.That(retrieveHidden, Is.Null, "Test Table With View should not be able to retrieve object filtered out of View As Query."); } @@ -973,7 +973,7 @@ public void TestTableWithViewAndRelation() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTableBaseView."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTableBaseView."); var relall = Database.SelectAllObjects(); @@ -981,27 +981,27 @@ public void TestTableWithViewAndRelation() var relnone = Database.SelectAllObjects(); - Assert.IsEmpty(relnone, "Database shouldn't have any record For TestTableRelationsEntries."); + Assert.That(relnone, Is.Empty, "Database shouldn't have any record For TestTableRelationsEntries."); // Insert some Object in Base View var objBase = new TestTableBaseView { TestField = "TestField for Base View With Relation", ViewValue = "This is a Value to be retrieve in View Relation..." }; var inserted = Database.AddObject(objBase); - Assert.IsTrue(inserted, "Test Table With View And Relation could not insert object in database."); + Assert.That(inserted, Is.True, "Test Table With View And Relation could not insert object in database."); var entries = Enumerable.Range(0, 5).Select(i => new TestTableRelationsEntries { TestField = string.Format("View Relation Test Field #{0}", i), ForeignTestField = objBase.ViewValue }); var relInserted = Database.AddObject(entries); - Assert.IsTrue(relInserted, "Test Table With View And Relation could not insert relations object in database."); + Assert.That(relInserted, Is.True, "Test Table With View And Relation could not insert relations object in database."); // Retrieve var viewRetrieve = Database.FindObjectByKey(objBase.PrimaryKey); - Assert.IsNotNull(viewRetrieve, "Test Table With View And Relation could not retrieve object from database."); - Assert.IsNotEmpty(viewRetrieve.Entries, "Test Table With View And Relation should have Relations Populated."); - CollectionAssert.AreEquivalent(entries.Select(obj => obj.TestField), viewRetrieve.Entries.Select(obj => obj.TestField), "Test Table With View And Relation should have Relations similar to Created Object"); + Assert.That(viewRetrieve, Is.Not.Null, "Test Table With View And Relation could not retrieve object from database."); + Assert.That(viewRetrieve.Entries, Is.Not.Empty, "Test Table With View And Relation should have Relations Populated."); + Assert.That(viewRetrieve.Entries.Select(obj => obj.TestField), Is.EquivalentTo(entries.Select(obj => obj.TestField)), "Test Table With View And Relation should have Relations similar to Created Object"); } /// @@ -1019,7 +1019,7 @@ public void TestTablePrimaryKeyWithPrecache() var none = Database.SelectAllObjects(); - Assert.IsEmpty(none, "Database shouldn't have any record For TestTablePrecachedPrimaryKey."); + Assert.That(none, Is.Empty, "Database shouldn't have any record For TestTablePrecachedPrimaryKey."); // Insert some Object var obj = new TestTablePrecachedPrimaryKey { TestField = "Test For Precached Table with Primary Key", PrecachedValue = "Some Value for Precache Table With Primary Key", @@ -1027,19 +1027,19 @@ public void TestTablePrimaryKeyWithPrecache() var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "Test Table Precached With Primary Key could not insert object in database."); + Assert.That(inserted, Is.True, "Test Table Precached With Primary Key could not insert object in database."); // Find it ! var retrieve = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(retrieve, "Test Table Precached With Primary Key could not retrieve object from database or precache using primary key."); - Assert.AreEqual(obj.PrimaryKey, retrieve.PrimaryKey, "Test Table Precached With Primary Key should retrieve Object with similar primary key."); + Assert.That(retrieve, Is.Not.Null, "Test Table Precached With Primary Key could not retrieve object from database or precache using primary key."); + Assert.That(retrieve.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Test Table Precached With Primary Key should retrieve Object with similar primary key."); // Find it with case insensitive... var retrieveCase = Database.FindObjectByKey(obj.PrimaryKey.ToUpper()); - Assert.IsNotNull(retrieveCase, "Test Table Precached With Primary Key should be able to retrieve object with primary key using different case."); - Assert.AreEqual(obj.PrimaryKey, retrieveCase.PrimaryKey, "Test Table Precached With Primary Key should retrieve Object with similar primary key."); + Assert.That(retrieveCase, Is.Not.Null, "Test Table Precached With Primary Key should be able to retrieve object with primary key using different case."); + Assert.That(retrieveCase.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Test Table Precached With Primary Key should retrieve Object with similar primary key."); } /// @@ -1056,8 +1056,8 @@ public void TestTableRelationsWithPrecached() Database.DeleteObject(Database.SelectAllObjects()); Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Relations Test With Precache should begin with Empty Table."); - Assert.IsEmpty(Database.SelectAllObjects(), "Relations Test With Precache should begin with Empty Table."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Relations Test With Precache should begin with Empty Table."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Relations Test With Precache should begin with Empty Table."); // Objects var objs = Enumerable.Range(0, 10).Select(i => new TestTableRelationsWithPrecache { TestField = string.Format("Test Table Relation with Precache #{0}", i) }).ToArray(); @@ -1067,39 +1067,39 @@ public void TestTableRelationsWithPrecached() var added = Database.AddObject(objs); - Assert.IsTrue(added, "Relations Test With Precache could not insert test objects."); + Assert.That(added, Is.True, "Relations Test With Precache could not insert test objects."); // Select var retrieve = Database.SelectAllObjects(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.ObjectId), retrieve.Select(obj => obj.ObjectId), "Relations Test With Precache should retrieve object similar to created ones."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.TestField), retrieve.Select(obj => obj.TestField), "Relations Test With Precache should retrieve object similar to created ones."); + Assert.That(retrieve.Select(obj => obj.ObjectId), Is.EquivalentTo(objs.Select(obj => obj.ObjectId)), "Relations Test With Precache should retrieve object similar to created ones."); + Assert.That(retrieve.Select(obj => obj.TestField), Is.EquivalentTo(objs.Select(obj => obj.TestField)), "Relations Test With Precache should retrieve object similar to created ones."); foreach (var ret in retrieve) { - CollectionAssert.AreEquivalent(objs.FirstOrDefault(obj => obj.ObjectId.Equals(ret.ObjectId)).Entries.Select(obj => obj.ObjectId), ret.Entries.Select(obj => obj.ObjectId), "Relations Test With Precache should retrieve object entries similar to created ones."); - CollectionAssert.AreEquivalent(objs.FirstOrDefault(obj => obj.ObjectId.Equals(ret.ObjectId)).Entries.Select(obj => obj.TestField), ret.Entries.Select(obj => obj.TestField), "Relations Test With Precache should retrieve object entries similar to created ones."); + Assert.That(ret.Entries.Select(obj => obj.ObjectId), Is.EquivalentTo(objs.FirstOrDefault(obj => obj.ObjectId.Equals(ret.ObjectId)).Entries.Select(obj => obj.ObjectId)), "Relations Test With Precache should retrieve object entries similar to created ones."); + Assert.That(ret.Entries.Select(obj => obj.TestField), Is.EquivalentTo(objs.FirstOrDefault(obj => obj.ObjectId.Equals(ret.ObjectId)).Entries.Select(obj => obj.TestField)), "Relations Test With Precache should retrieve object entries similar to created ones."); } Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Relations Test With Precache should have Empty Entry Table for cache test."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Relations Test With Precache should have Empty Entry Table for cache test."); Database.FillObjectRelations(objs); foreach (var obj in objs) - Assert.IsNull(obj.Entries, "Relation Test With Precache should have objects with null relations after entry deletion."); + Assert.That(obj.Entries, Is.Null, "Relation Test With Precache should have objects with null relations after entry deletion."); // Try Select with no relation var norel = new TestTableRelationsWithPrecache { TestField = "Test Table Relation with Precache without relations..." }; Database.AddObject(norel); var selectInserted = Database.SelectAllObjects().Single(obj => obj.TestField.Equals(norel.TestField)); - Assert.IsNull(selectInserted.Entries, "Relations Test With Precache should return null for Entries stored without relation."); + Assert.That(selectInserted.Entries, Is.Null, "Relations Test With Precache should return null for Entries stored without relation."); // Try Fill with null Local Value var reAddEntries = Database.AddObject(Enumerable.Range(0, 5).Select(i => new TestTableRelationsEntriesPrecached { ForeignTestField = IDGenerator.GenerateID(), TestField = string.Format("Test Table NOT Related Entry with Precache #{0}", i) })); - Assert.IsTrue(reAddEntries, "Relations Test With Precache Relation Entries could not be inserted for testing..."); + Assert.That(reAddEntries, Is.True, "Relations Test With Precache Relation Entries could not be inserted for testing..."); foreach(var obj in objs) { @@ -1110,7 +1110,7 @@ public void TestTableRelationsWithPrecached() Database.FillObjectRelations(objs); foreach (var obj in objs) - Assert.IsNull(obj.Entries, "Relation Test With Precache should have objects with null relations with null local."); + Assert.That(obj.Entries, Is.Null, "Relation Test With Precache should have objects with null relations with null local."); } [Test] @@ -1123,39 +1123,39 @@ public void TestTableRelationWithPrecacheAndPrimaryRemote() Database.DeleteObject(Database.SelectAllObjects()); Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Relations Test With Precache and Primary should begin with Empty Table."); - Assert.IsEmpty(Database.SelectAllObjects(), "Relations Test With Precache and Primary should begin with Empty Table."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Relations Test With Precache and Primary should begin with Empty Table."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Relations Test With Precache and Primary should begin with Empty Table."); // Add one object with no relation var norel = new TestTableRelationsWithPrecacheAndPrimary { TestField = "Table Relation With Precache and Primary Remote" }; var added = Database.AddObject(norel); - Assert.IsTrue(added, "Relations Test With Precache and Primary could not add test object."); + Assert.That(added, Is.True, "Relations Test With Precache and Primary could not add test object."); // Try selecting var retrieve = Database.SelectAllObjects().Single(); - Assert.AreEqual(norel.TestField, retrieve.TestField, "Relations Test With Precache and Primary should retrieve similar object."); - Assert.IsNull(retrieve.Entry, "Relations Test With Precache and Primary should not have relation set for no relation object."); + Assert.That(retrieve.TestField, Is.EqualTo(norel.TestField), "Relations Test With Precache and Primary should retrieve similar object."); + Assert.That(retrieve.Entry, Is.Null, "Relations Test With Precache and Primary should not have relation set for no relation object."); // Add relation var relobj = new TestTableRelationsEntryPrecached { ForeignTestField = "Some Data", ObjectId = norel.ObjectId }; var reladded = Database.AddObject(relobj); - Assert.IsTrue(reladded, "Relations Test With Precache and Primary could not add test relation entry."); + Assert.That(reladded, Is.True, "Relations Test With Precache and Primary could not add test relation entry."); // Try selecting var relretrieve = Database.SelectAllObjects().Single(); - Assert.AreEqual(norel.TestField, relretrieve.TestField, "Relations Test With Precache and Primary should retrieve similar object."); - Assert.IsNotNull(relretrieve.Entry, "Relations Test With Precache and Primary should have valid relation entry."); - Assert.AreEqual(relobj.ForeignTestField, relretrieve.Entry.ForeignTestField, "Relations Test With Precache and Primary should retrieve similar relation object."); + Assert.That(relretrieve.TestField, Is.EqualTo(norel.TestField), "Relations Test With Precache and Primary should retrieve similar object."); + Assert.That(relretrieve.Entry, Is.Not.Null, "Relations Test With Precache and Primary should have valid relation entry."); + Assert.That(relretrieve.Entry.ForeignTestField, Is.EqualTo(relobj.ForeignTestField), "Relations Test With Precache and Primary should retrieve similar relation object."); // Try Null Value Relation relretrieve.ObjectId = null; Database.FillObjectRelations(relretrieve); - Assert.IsNull(relretrieve.Entry, "Relations Test With Precache and Primary should return null value for null local field relation..."); + Assert.That(relretrieve.Entry, Is.Null, "Relations Test With Precache and Primary should return null value for null local field relation..."); } [Test] @@ -1169,7 +1169,7 @@ public void SelectObject_TestFieldContainsSpecialISO88591signs_TestfieldIsUnalte var actual = Database.FindObjectByKey(dataObject.ObjectId).TestField; var expected = dataObject.TestField; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -1183,7 +1183,7 @@ public void SelectObject_TestFieldContainsSpecialCp1252signs_TestfieldIsUnaltere var actual = Database.FindObjectByKey(dataObject.ObjectId).TestField; var expected = dataObject.TestField; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } private void AddOrReplaceObject(T dataObject) where T : DataObject diff --git a/Tests/IntegrationTests/Database/DatabaseTypeTests.cs b/Tests/IntegrationTests/Database/DatabaseTypeTests.cs index cd79ff00b7..a6c27932bc 100644 --- a/Tests/IntegrationTests/Database/DatabaseTypeTests.cs +++ b/Tests/IntegrationTests/Database/DatabaseTypeTests.cs @@ -59,24 +59,24 @@ public void TestBooleanNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Boolean (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Boolean (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Boolean (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Boolean (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Boolean (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Bool, objRetrieved.Bool, "DatabaseTypeTests: in Boolean (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Boolean (NonNull) Test."); + Assert.That(objRetrieved.Bool, Is.EqualTo(obj.Bool), "DatabaseTypeTests: in Boolean (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Bool = true; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Boolean (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Boolean (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Boolean (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Boolean (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Boolean (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Bool, objReRetrieved.Bool, "DatabaseTypeTests: in Boolean (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Boolean (NonNull) Test."); + Assert.That(objReRetrieved.Bool, Is.EqualTo(obj.Bool), "DatabaseTypeTests: in Boolean (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -89,24 +89,24 @@ public void TestBooleanNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Boolean (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Boolean (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Boolean (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Boolean (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Boolean (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Bool, objRetrieved.Bool, "DatabaseTypeTests: in Boolean (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Boolean (Null) Test."); + Assert.That(objRetrieved.Bool, Is.EqualTo(obj.Bool), "DatabaseTypeTests: in Boolean (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Bool = true; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Boolean (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Boolean (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Boolean (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Boolean (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Boolean (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Bool, objReRetrieved.Bool, "DatabaseTypeTests: in Boolean (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Boolean (Null) Test."); + Assert.That(objReRetrieved.Bool, Is.EqualTo(obj.Bool), "DatabaseTypeTests: in Boolean (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -123,35 +123,35 @@ public void TestCharNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Char (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Char (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Char (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Char (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Char (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Char, objRetrieved.Char, "DatabaseTypeTests: in Char (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Char (NonNull) Test."); + Assert.That(objRetrieved.Char, Is.EqualTo(obj.Char), "DatabaseTypeTests: in Char (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Char = char.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Char (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Char (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Char (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Char (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Char (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Char, objReRetrieved.Char, "DatabaseTypeTests: in Char (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Char (NonNull) Test."); + Assert.That(objReRetrieved.Char, Is.EqualTo(obj.Char), "DatabaseTypeTests: in Char (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Char = default(char); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Char (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Char (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Char (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Char (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Char (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Char, objReReRetrieved.Char, "DatabaseTypeTests: in Char (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Char (NonNull) Test."); + Assert.That(objReReRetrieved.Char, Is.EqualTo(obj.Char), "DatabaseTypeTests: in Char (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -164,35 +164,35 @@ public void TestCharNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Char (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Char (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Char (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Char (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Char (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Char, objRetrieved.Char, "DatabaseTypeTests: in Char (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Char (Null) Test."); + Assert.That(objRetrieved.Char, Is.EqualTo(obj.Char), "DatabaseTypeTests: in Char (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Char = char.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Char (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Char (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Char (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Char (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Char (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Char, objReRetrieved.Char, "DatabaseTypeTests: in Char (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Char (Null) Test."); + Assert.That(objReRetrieved.Char, Is.EqualTo(obj.Char), "DatabaseTypeTests: in Char (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Char = default(char); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Char (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Char (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Char (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Char (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Char (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Char, objReReRetrieved.Char, "DatabaseTypeTests: in Char (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Char (Null) Test."); + Assert.That(objReReRetrieved.Char, Is.EqualTo(obj.Char), "DatabaseTypeTests: in Char (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -209,35 +209,35 @@ public void TestByteNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Byte (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Byte (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Byte (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Byte (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Byte (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objRetrieved.Byte, "DatabaseTypeTests: in Byte (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Byte (NonNull) Test."); + Assert.That(objRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Byte (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Byte = byte.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Byte (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Byte (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Byte (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Byte (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Byte (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objReRetrieved.Byte, "DatabaseTypeTests: in Byte (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Byte (NonNull) Test."); + Assert.That(objReRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Byte (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Byte = default(byte); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Byte (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Byte (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Byte (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Byte (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Byte (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objReReRetrieved.Byte, "DatabaseTypeTests: in Byte (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Byte (NonNull) Test."); + Assert.That(objReReRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Byte (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -250,35 +250,35 @@ public void TestByteNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Byte (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Byte (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Byte (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Byte (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Byte (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objRetrieved.Byte, "DatabaseTypeTests: in Byte (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Byte (Null) Test."); + Assert.That(objRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Byte (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Byte = byte.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Byte (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Byte (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Byte (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Byte (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Byte (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objReRetrieved.Byte, "DatabaseTypeTests: in Byte (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Byte (Null) Test."); + Assert.That(objReRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Byte (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Byte = default(byte); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Byte (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Byte (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Byte (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Byte (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Byte (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objReReRetrieved.Byte, "DatabaseTypeTests: in Byte (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Byte (Null) Test."); + Assert.That(objReReRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Byte (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -295,35 +295,35 @@ public void TestSbyteNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Sbyte (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Sbyte (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Sbyte (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Sbyte (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Sbyte (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Sbyte, objRetrieved.Sbyte, "DatabaseTypeTests: in Sbyte (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Sbyte (NonNull) Test."); + Assert.That(objRetrieved.Sbyte, Is.EqualTo(obj.Sbyte), "DatabaseTypeTests: in Sbyte (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Sbyte = sbyte.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Sbyte (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Sbyte (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Sbyte (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Sbyte (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Sbyte (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Sbyte, objReRetrieved.Sbyte, "DatabaseTypeTests: in Sbyte (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Sbyte (NonNull) Test."); + Assert.That(objReRetrieved.Sbyte, Is.EqualTo(obj.Sbyte), "DatabaseTypeTests: in Sbyte (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Sbyte = default(sbyte); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Sbyte (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Sbyte (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Sbyte (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Sbyte (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Sbyte (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Sbyte, objReReRetrieved.Sbyte, "DatabaseTypeTests: in Sbyte (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Sbyte (NonNull) Test."); + Assert.That(objReReRetrieved.Sbyte, Is.EqualTo(obj.Sbyte), "DatabaseTypeTests: in Sbyte (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -336,35 +336,35 @@ public void TestSbyteNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Sbyte (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Sbyte (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Sbyte (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Sbyte (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Sbyte (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Sbyte, objRetrieved.Sbyte, "DatabaseTypeTests: in Sbyte (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Sbyte (Null) Test."); + Assert.That(objRetrieved.Sbyte, Is.EqualTo(obj.Sbyte), "DatabaseTypeTests: in Sbyte (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Sbyte = sbyte.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Sbyte (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Sbyte (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Sbyte (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Sbyte (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Sbyte (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Sbyte, objReRetrieved.Sbyte, "DatabaseTypeTests: in Sbyte (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Sbyte (Null) Test."); + Assert.That(objReRetrieved.Sbyte, Is.EqualTo(obj.Sbyte), "DatabaseTypeTests: in Sbyte (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Sbyte = default(sbyte); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Sbyte (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Sbyte (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Sbyte (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Sbyte (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Sbyte (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Byte, objReReRetrieved.Byte, "DatabaseTypeTests: in Sbyte (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Sbyte (Null) Test."); + Assert.That(objReReRetrieved.Byte, Is.EqualTo(obj.Byte), "DatabaseTypeTests: in Sbyte (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -381,35 +381,35 @@ public void TestUShortNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in UShort (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in UShort (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in UShort (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in UShort (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UShort (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UShort, objRetrieved.UShort, "DatabaseTypeTests: in UShort (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UShort (NonNull) Test."); + Assert.That(objRetrieved.UShort, Is.EqualTo(obj.UShort), "DatabaseTypeTests: in UShort (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.UShort = ushort.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in UShort (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in UShort (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in UShort (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in UShort (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UShort (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UShort, objReRetrieved.UShort, "DatabaseTypeTests: in UShort (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UShort (NonNull) Test."); + Assert.That(objReRetrieved.UShort, Is.EqualTo(obj.UShort), "DatabaseTypeTests: in UShort (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.UShort = default(ushort); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in UShort (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in UShort (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in UShort (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in UShort (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UShort (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UShort, objReReRetrieved.UShort, "DatabaseTypeTests: in UShort (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UShort (NonNull) Test."); + Assert.That(objReReRetrieved.UShort, Is.EqualTo(obj.UShort), "DatabaseTypeTests: in UShort (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -422,35 +422,35 @@ public void TestUShortNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in UShort (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in UShort (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in UShort (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in UShort (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UShort (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UShort, objRetrieved.UShort, "DatabaseTypeTests: in UShort (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UShort (Null) Test."); + Assert.That(objRetrieved.UShort, Is.EqualTo(obj.UShort), "DatabaseTypeTests: in UShort (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.UShort = ushort.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in UShort (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in UShort (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in UShort (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in UShort (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UShort (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UShort, objReRetrieved.UShort, "DatabaseTypeTests: in UShort (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UShort (Null) Test."); + Assert.That(objReRetrieved.UShort, Is.EqualTo(obj.UShort), "DatabaseTypeTests: in UShort (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.UShort = default(ushort); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in UShort (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in UShort (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in UShort (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in UShort (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UShort (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UShort, objReReRetrieved.UShort, "DatabaseTypeTests: in UShort (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UShort (Null) Test."); + Assert.That(objReReRetrieved.UShort, Is.EqualTo(obj.UShort), "DatabaseTypeTests: in UShort (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -467,35 +467,35 @@ public void TestShortNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Short (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Short (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Short (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Short (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Short (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Short, objRetrieved.Short, "DatabaseTypeTests: in Short (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Short (NonNull) Test."); + Assert.That(objRetrieved.Short, Is.EqualTo(obj.Short), "DatabaseTypeTests: in Short (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Short = short.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Short (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Short (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Short (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Short (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Short (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Short, objReRetrieved.Short, "DatabaseTypeTests: in Short (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Short (NonNull) Test."); + Assert.That(objReRetrieved.Short, Is.EqualTo(obj.Short), "DatabaseTypeTests: in Short (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Short = default(short); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Short (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Short (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Short (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Short (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Short (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Short, objReReRetrieved.Short, "DatabaseTypeTests: in Short (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Short (NonNull) Test."); + Assert.That(objReReRetrieved.Short, Is.EqualTo(obj.Short), "DatabaseTypeTests: in Short (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -508,35 +508,35 @@ public void TestShortNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Short (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Short (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Short (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Short (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Short (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Short, objRetrieved.Short, "DatabaseTypeTests: in Short (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Short (Null) Test."); + Assert.That(objRetrieved.Short, Is.EqualTo(obj.Short), "DatabaseTypeTests: in Short (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Short = short.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Short (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Short (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Short (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Short (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Short (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Short, objReRetrieved.Short, "DatabaseTypeTests: in Short (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Short (Null) Test."); + Assert.That(objReRetrieved.Short, Is.EqualTo(obj.Short), "DatabaseTypeTests: in Short (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Short = default(short); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Short (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Short (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Short (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Short (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Short (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Short, objReReRetrieved.Short, "DatabaseTypeTests: in Short (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Short (Null) Test."); + Assert.That(objReReRetrieved.Short, Is.EqualTo(obj.Short), "DatabaseTypeTests: in Short (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -553,35 +553,35 @@ public void TestUIntNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in UInt (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in UInt (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in UInt (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in UInt (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UInt (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UInt, objRetrieved.UInt, "DatabaseTypeTests: in UInt (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UInt (NonNull) Test."); + Assert.That(objRetrieved.UInt, Is.EqualTo(obj.UInt), "DatabaseTypeTests: in UInt (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.UInt = uint.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in UInt (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in UInt (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in UInt (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in UInt (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UInt (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UInt, objReRetrieved.UInt, "DatabaseTypeTests: in UInt (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UInt (NonNull) Test."); + Assert.That(objReRetrieved.UInt, Is.EqualTo(obj.UInt), "DatabaseTypeTests: in UInt (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.UInt = default(uint); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in UInt (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in UInt (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in UInt (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in UInt (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UInt (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UInt, objReReRetrieved.UInt, "DatabaseTypeTests: in UInt (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UInt (NonNull) Test."); + Assert.That(objReReRetrieved.UInt, Is.EqualTo(obj.UInt), "DatabaseTypeTests: in UInt (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -594,35 +594,35 @@ public void TestUIntNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in UInt (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in UInt (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in UInt (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in UInt (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UInt (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UInt, objRetrieved.UInt, "DatabaseTypeTests: in UInt (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UInt (Null) Test."); + Assert.That(objRetrieved.UInt, Is.EqualTo(obj.UInt), "DatabaseTypeTests: in UInt (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.UInt = uint.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in UInt (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in UInt (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in UInt (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in UInt (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UInt (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UInt, objReRetrieved.UInt, "DatabaseTypeTests: in UInt (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UInt (Null) Test."); + Assert.That(objReRetrieved.UInt, Is.EqualTo(obj.UInt), "DatabaseTypeTests: in UInt (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.UInt = default(uint); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in UInt (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in UInt (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in UInt (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in UInt (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in UInt (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.UInt, objReReRetrieved.UInt, "DatabaseTypeTests: in UInt (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in UInt (Null) Test."); + Assert.That(objReReRetrieved.UInt, Is.EqualTo(obj.UInt), "DatabaseTypeTests: in UInt (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -639,35 +639,35 @@ public void TestIntNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Int (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Int (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Int (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Int (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Int (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Int, objRetrieved.Int, "DatabaseTypeTests: in Int (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Int (NonNull) Test."); + Assert.That(objRetrieved.Int, Is.EqualTo(obj.Int), "DatabaseTypeTests: in Int (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Int = int.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Int (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Int (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Int (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Int (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Int (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Int, objReRetrieved.Int, "DatabaseTypeTests: in Int (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Int (NonNull) Test."); + Assert.That(objReRetrieved.Int, Is.EqualTo(obj.Int), "DatabaseTypeTests: in Int (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Int = default(int); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Int (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Int (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Int (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Int (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Int (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Int, objReReRetrieved.Int, "DatabaseTypeTests: in Int (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Int (NonNull) Test."); + Assert.That(objReReRetrieved.Int, Is.EqualTo(obj.Int), "DatabaseTypeTests: in Int (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -680,35 +680,35 @@ public void TestIntNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Int (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Int (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Int (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Int (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Int (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Int, objRetrieved.Int, "DatabaseTypeTests: in Int (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Int (Null) Test."); + Assert.That(objRetrieved.Int, Is.EqualTo(obj.Int), "DatabaseTypeTests: in Int (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Int = int.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Int (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Int (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Int (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Int (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Int (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Int, objReRetrieved.Int, "DatabaseTypeTests: in Int (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Int (Null) Test."); + Assert.That(objReRetrieved.Int, Is.EqualTo(obj.Int), "DatabaseTypeTests: in Int (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Int = default(int); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Int (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Int (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Int (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Int (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Int (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Int, objReReRetrieved.Int, "DatabaseTypeTests: in Int (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Int (Null) Test."); + Assert.That(objReReRetrieved.Int, Is.EqualTo(obj.Int), "DatabaseTypeTests: in Int (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -725,35 +725,35 @@ public void TestULongNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in ULong (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in ULong (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in ULong (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in ULong (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in ULong (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.ULong, objRetrieved.ULong, "DatabaseTypeTests: in ULong (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in ULong (NonNull) Test."); + Assert.That(objRetrieved.ULong, Is.EqualTo(obj.ULong), "DatabaseTypeTests: in ULong (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.ULong = ulong.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in ULong (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in ULong (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in ULong (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in ULong (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in ULong (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.ULong, objReRetrieved.ULong, "DatabaseTypeTests: in ULong (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in ULong (NonNull) Test."); + Assert.That(objReRetrieved.ULong, Is.EqualTo(obj.ULong), "DatabaseTypeTests: in ULong (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.ULong = default(ulong); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in ULong (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in ULong (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in ULong (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in ULong (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in ULong (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.ULong, objReReRetrieved.ULong, "DatabaseTypeTests: in ULong (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in ULong (NonNull) Test."); + Assert.That(objReReRetrieved.ULong, Is.EqualTo(obj.ULong), "DatabaseTypeTests: in ULong (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -766,35 +766,35 @@ public void TestULongNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in ULong (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in ULong (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in ULong (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in ULong (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in ULong (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.ULong, objRetrieved.ULong, "DatabaseTypeTests: in ULong (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in ULong (Null) Test."); + Assert.That(objRetrieved.ULong, Is.EqualTo(obj.ULong), "DatabaseTypeTests: in ULong (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.ULong = ulong.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in ULong (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in ULong (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in ULong (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in ULong (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in ULong (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.ULong, objReRetrieved.ULong, "DatabaseTypeTests: in ULong (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in ULong (Null) Test."); + Assert.That(objReRetrieved.ULong, Is.EqualTo(obj.ULong), "DatabaseTypeTests: in ULong (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.ULong = default(ulong); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in ULong (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in ULong (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in ULong (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in ULong (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in ULong (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.ULong, objReReRetrieved.ULong, "DatabaseTypeTests: in ULong (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in ULong (Null) Test."); + Assert.That(objReReRetrieved.ULong, Is.EqualTo(obj.ULong), "DatabaseTypeTests: in ULong (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -811,35 +811,35 @@ public void TestLongNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Long (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Long (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Long (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Long (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Long (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Long, objRetrieved.Long, "DatabaseTypeTests: in Long (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Long (NonNull) Test."); + Assert.That(objRetrieved.Long, Is.EqualTo(obj.Long), "DatabaseTypeTests: in Long (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Long = long.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Long (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Long (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Long (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Long (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Long (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Long, objReRetrieved.Long, "DatabaseTypeTests: in Long (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Long (NonNull) Test."); + Assert.That(objReRetrieved.Long, Is.EqualTo(obj.Long), "DatabaseTypeTests: in Long (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Long = default(long); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Long (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Long (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Long (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Long (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Long (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Long, objReReRetrieved.Long, "DatabaseTypeTests: in Long (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Long (NonNull) Test."); + Assert.That(objReReRetrieved.Long, Is.EqualTo(obj.Long), "DatabaseTypeTests: in Long (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -852,35 +852,35 @@ public void TestLongNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Long (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Long (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Long (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Long (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Long (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Long, objRetrieved.Long, "DatabaseTypeTests: in Long (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Long (Null) Test."); + Assert.That(objRetrieved.Long, Is.EqualTo(obj.Long), "DatabaseTypeTests: in Long (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Long = long.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Long (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Long (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Long (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Long (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Long (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Long, objReRetrieved.Long, "DatabaseTypeTests: in Long (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Long (Null) Test."); + Assert.That(objReRetrieved.Long, Is.EqualTo(obj.Long), "DatabaseTypeTests: in Long (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Long = default(long); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Long (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Long (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Long (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Long (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Long (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Long, objReReRetrieved.Long, "DatabaseTypeTests: in Long (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Long (Null) Test."); + Assert.That(objReReRetrieved.Long, Is.EqualTo(obj.Long), "DatabaseTypeTests: in Long (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -897,35 +897,35 @@ public void TestFloatNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Float (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Float (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Float (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Float (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Float (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Float, objRetrieved.Float, "DatabaseTypeTests: in Float (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Float (NonNull) Test."); + Assert.That(objRetrieved.Float, Is.EqualTo(obj.Float), "DatabaseTypeTests: in Float (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Float = float.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Float (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Float (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Float (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Float (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Float (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Float, objReRetrieved.Float, "DatabaseTypeTests: in Float (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Float (NonNull) Test."); + Assert.That(objReRetrieved.Float, Is.EqualTo(obj.Float), "DatabaseTypeTests: in Float (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Float = (float)0.1; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Float (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Float (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Float (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Float (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Float (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Float, objReReRetrieved.Float, "DatabaseTypeTests: in Float (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Float (NonNull) Test."); + Assert.That(objReReRetrieved.Float, Is.EqualTo(obj.Float), "DatabaseTypeTests: in Float (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -938,35 +938,35 @@ public void TestFloatNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Float (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Float (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Float (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Float (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Float (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Float, objRetrieved.Float, "DatabaseTypeTests: in Float (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Float (Null) Test."); + Assert.That(objRetrieved.Float, Is.EqualTo(obj.Float), "DatabaseTypeTests: in Float (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Float = float.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Float (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Float (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Float (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Float (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Float (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Float, objReRetrieved.Float, "DatabaseTypeTests: in Float (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Float (Null) Test."); + Assert.That(objReRetrieved.Float, Is.EqualTo(obj.Float), "DatabaseTypeTests: in Float (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Float = (float)0.1; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Float (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Float (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Float (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Float (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Float (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Float, objReReRetrieved.Float, "DatabaseTypeTests: in Float (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Float (Null) Test."); + Assert.That(objReReRetrieved.Float, Is.EqualTo(obj.Float), "DatabaseTypeTests: in Float (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -983,35 +983,35 @@ public void TestDoubleNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Double (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Double (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Double (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Double (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Double (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Double, objRetrieved.Double, "DatabaseTypeTests: in Double (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Double (NonNull) Test."); + Assert.That(objRetrieved.Double, Is.EqualTo(obj.Double), "DatabaseTypeTests: in Double (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Double = double.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Double (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Double (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Double (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Double (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Double (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Double, objReRetrieved.Double, "DatabaseTypeTests: in Double (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Double (NonNull) Test."); + Assert.That(objReRetrieved.Double, Is.EqualTo(obj.Double), "DatabaseTypeTests: in Double (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Double = (double)0.1; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Double (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Double (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Double (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Double (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Double (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Double, objReReRetrieved.Double, "DatabaseTypeTests: in Double (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Double (NonNull) Test."); + Assert.That(objReReRetrieved.Double, Is.EqualTo(obj.Double), "DatabaseTypeTests: in Double (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1024,35 +1024,35 @@ public void TestDoubleNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Double (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Double (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Double (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Double (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Double (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Double, objRetrieved.Double, "DatabaseTypeTests: in Double (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Double (Null) Test."); + Assert.That(objRetrieved.Double, Is.EqualTo(obj.Double), "DatabaseTypeTests: in Double (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Double = double.MaxValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Double (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Double (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Double (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Double (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Double (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Double, objReRetrieved.Double, "DatabaseTypeTests: in Double (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Double (Null) Test."); + Assert.That(objReRetrieved.Double, Is.EqualTo(obj.Double), "DatabaseTypeTests: in Double (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Double = (double)0.1; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Double (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Double (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Double (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Double (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Double (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Double, objReReRetrieved.Double, "DatabaseTypeTests: in Double (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Double (Null) Test."); + Assert.That(objReReRetrieved.Double, Is.EqualTo(obj.Double), "DatabaseTypeTests: in Double (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1069,35 +1069,35 @@ public void TestDateTimeNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in DateTime (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in DateTime (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in DateTime (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in DateTime (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in DateTime (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.DateTime, objRetrieved.DateTime, "DatabaseTypeTests: in DateTime (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in DateTime (NonNull) Test."); + Assert.That(objRetrieved.DateTime, Is.EqualTo(obj.DateTime), "DatabaseTypeTests: in DateTime (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.DateTime = DateTime.MinValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in DateTime (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in DateTime (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in DateTime (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in DateTime (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in DateTime (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.DateTime, objReRetrieved.DateTime, "DatabaseTypeTests: in DateTime (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in DateTime (NonNull) Test."); + Assert.That(objReRetrieved.DateTime, Is.EqualTo(obj.DateTime), "DatabaseTypeTests: in DateTime (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.DateTime = default(DateTime); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in DateTime (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in DateTime (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in DateTime (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in DateTime (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in DateTime (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.DateTime, objReReRetrieved.DateTime, "DatabaseTypeTests: in DateTime (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in DateTime (NonNull) Test."); + Assert.That(objReReRetrieved.DateTime, Is.EqualTo(obj.DateTime), "DatabaseTypeTests: in DateTime (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1110,35 +1110,35 @@ public void TestDateTimeNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in DateTime (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in DateTime (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in DateTime (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in DateTime (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in DateTime (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.DateTime, objRetrieved.DateTime, "DatabaseTypeTests: in DateTime (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in DateTime (Null) Test."); + Assert.That(objRetrieved.DateTime, Is.EqualTo(obj.DateTime), "DatabaseTypeTests: in DateTime (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.DateTime = DateTime.MinValue; var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in DateTime (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in DateTime (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in DateTime (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in DateTime (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in DateTime (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.DateTime, objReRetrieved.DateTime, "DatabaseTypeTests: in DateTime (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in DateTime (Null) Test."); + Assert.That(objReRetrieved.DateTime, Is.EqualTo(obj.DateTime), "DatabaseTypeTests: in DateTime (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.DateTime = default(DateTime); var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in DateTime (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in DateTime (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in DateTime (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in DateTime (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in DateTime (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.DateTime, objReReRetrieved.DateTime, "DatabaseTypeTests: in DateTime (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in DateTime (Null) Test."); + Assert.That(objReReRetrieved.DateTime, Is.EqualTo(obj.DateTime), "DatabaseTypeTests: in DateTime (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1155,35 +1155,35 @@ public void TestStringNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in String (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in String (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in String (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in String (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in String (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.String, objRetrieved.String, "DatabaseTypeTests: in String (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in String (NonNull) Test."); + Assert.That(objRetrieved.String, Is.EqualTo(obj.String), "DatabaseTypeTests: in String (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.String = new string(Enumerable.Range(0, 199).Select(i => 'z').Concat(new [] { '@' }).ToArray()); var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in String (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in String (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in String (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in String (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in String (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.String, objReRetrieved.String, "DatabaseTypeTests: in String (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in String (NonNull) Test."); + Assert.That(objReRetrieved.String, Is.EqualTo(obj.String), "DatabaseTypeTests: in String (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.String = string.Empty; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in String (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in String (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in String (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in String (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in String (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.String, objReReRetrieved.String, "DatabaseTypeTests: in String (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in String (NonNull) Test."); + Assert.That(objReReRetrieved.String, Is.EqualTo(obj.String), "DatabaseTypeTests: in String (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1196,35 +1196,35 @@ public void TestStringNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in String (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in String (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in String (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in String (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in String (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.String, objRetrieved.String, "DatabaseTypeTests: in String (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in String (Null) Test."); + Assert.That(objRetrieved.String, Is.EqualTo(obj.String), "DatabaseTypeTests: in String (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.String = new string(Enumerable.Range(0, 199).Select(i => 'z').Concat(new [] { '@' }).ToArray()); var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in String (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in String (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in String (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in String (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in String (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.String, objReRetrieved.String, "DatabaseTypeTests: in String (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in String (Null) Test."); + Assert.That(objReRetrieved.String, Is.EqualTo(obj.String), "DatabaseTypeTests: in String (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.String = "a"; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in String (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in String (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in String (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in String (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in String (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.String, objReReRetrieved.String, "DatabaseTypeTests: in String (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in String (Null) Test."); + Assert.That(objReReRetrieved.String, Is.EqualTo(obj.String), "DatabaseTypeTests: in String (Null) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1241,35 +1241,35 @@ public void TestTextNonNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Text (NonNull) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Text (NonNull) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Text (NonNull) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Text (NonNull) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Text (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Text, objRetrieved.Text, "DatabaseTypeTests: in Text (NonNull) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Text (NonNull) Test."); + Assert.That(objRetrieved.Text, Is.EqualTo(obj.Text), "DatabaseTypeTests: in Text (NonNull) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Text = new string(Enumerable.Range(0, 65534).Select(i => 'z').Concat(new [] { '@' }).ToArray()); var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Text (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Text (NonNull) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Text (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Text (NonNull) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Text (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Text, objReRetrieved.Text, "DatabaseTypeTests: in Text (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Text (NonNull) Test."); + Assert.That(objReRetrieved.Text, Is.EqualTo(obj.Text), "DatabaseTypeTests: in Text (NonNull) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Text = string.Empty; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Text (NonNull) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Text (NonNull) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Text (NonNull) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Text (NonNull) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Text (NonNull) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Text, objReReRetrieved.Text, "DatabaseTypeTests: in Text (NonNull) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Text (NonNull) Test."); + Assert.That(objReReRetrieved.Text, Is.EqualTo(obj.Text), "DatabaseTypeTests: in Text (NonNull) Saved Value and Retrieved Value should be Equal."); } [Test] @@ -1282,35 +1282,35 @@ public void TestTextNull() // Test Add var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "DatabaseTypeTests: Could not insert object in Text (Null) Test."); - Assert.IsTrue(obj.IsPersisted, "DatabaseTypeTests: Inserted Object in Text (Null) Test doesn't have Persisted Flag set."); + Assert.That(inserted, Is.True, "DatabaseTypeTests: Could not insert object in Text (Null) Test."); + Assert.That(obj.IsPersisted, Is.True, "DatabaseTypeTests: Inserted Object in Text (Null) Test doesn't have Persisted Flag set."); // Test Read var objRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Text (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Text, objRetrieved.Text, "DatabaseTypeTests: in Text (Null) Insterted Value and Retrieved Value should be Equal."); + Assert.That(objRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Text (Null) Test."); + Assert.That(objRetrieved.Text, Is.EqualTo(obj.Text), "DatabaseTypeTests: in Text (Null) Insterted Value and Retrieved Value should be Equal."); // Test Save obj.Text = new string(Enumerable.Range(0, 65534).Select(i => 'z').Concat(new [] { '@' }).ToArray()); var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "DatabaseTypeTests: Could not save objet in Text (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Saved Object in Text (Null) Test still have Dirty Flag set."); + Assert.That(saved, Is.True, "DatabaseTypeTests: Could not save objet in Text (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Saved Object in Text (Null) Test still have Dirty Flag set."); // Test Re-Read var objReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Text (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Text, objReRetrieved.Text, "DatabaseTypeTests: in Text (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Text (Null) Test."); + Assert.That(objReRetrieved.Text, Is.EqualTo(obj.Text), "DatabaseTypeTests: in Text (Null) Saved Value and Retrieved Value should be Equal."); // Test Re-Save obj.Text = "a"; var reSaved = Database.SaveObject(obj); - Assert.IsTrue(reSaved, "DatabaseTypeTests: Could not Re-Save objet in Text (Null) Test."); - Assert.IsFalse(obj.Dirty, "DatabaseTypeTests: Re-Saved Object in Text (Null) Test still have Dirty Flag set."); + Assert.That(reSaved, Is.True, "DatabaseTypeTests: Could not Re-Save objet in Text (Null) Test."); + Assert.That(obj.Dirty, Is.False, "DatabaseTypeTests: Re-Saved Object in Text (Null) Test still have Dirty Flag set."); // Test Re-Re-Read var objReReRetrieved = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(objReReRetrieved, "DatabaseTypeTests: Could not retrieve object (ID {0}) in Text (Null) Test.", obj.PrimaryKey); - Assert.AreEqual(obj.Text, objReReRetrieved.Text, "DatabaseTypeTests: in Text (Null) Saved Value and Retrieved Value should be Equal."); + Assert.That(objReReRetrieved, Is.Not.Null, $"DatabaseTypeTests: Could not retrieve object (ID {obj.PrimaryKey}) in Text (Null) Test."); + Assert.That(objReReRetrieved.Text, Is.EqualTo(obj.Text), "DatabaseTypeTests: in Text (Null) Saved Value and Retrieved Value should be Equal."); } } diff --git a/Tests/IntegrationTests/Database/InterfaceTests.cs b/Tests/IntegrationTests/Database/InterfaceTests.cs index 27a7d3a778..8bf67898c1 100644 --- a/Tests/IntegrationTests/Database/InterfaceTests.cs +++ b/Tests/IntegrationTests/Database/InterfaceTests.cs @@ -49,21 +49,21 @@ public void TestSingleAdd() var objId = obj.ObjectId; - Assert.IsFalse(obj.IsPersisted, "Test Object should not have Persisted Flag before adding..."); - Assert.IsTrue(obj.Dirty, "Test Object should be Dirty before adding..."); + Assert.That(obj.IsPersisted, Is.False, "Test Object should not have Persisted Flag before adding..."); + Assert.That(obj.Dirty, Is.True, "Test Object should be Dirty before adding..."); var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "Test Object should be inserted successfully, something went wrong..."); - Assert.IsTrue(obj.IsPersisted, "Test Object should have Persisted Flag after adding to database..."); - Assert.IsFalse(obj.Dirty, "Test Object should not be Dirty after adding to database..."); - Assert.AreEqual(objId, obj.ObjectId, "Test Object should have kept its ObjectId from Creation..."); + Assert.That(inserted, Is.True, "Test Object should be inserted successfully, something went wrong..."); + Assert.That(obj.IsPersisted, Is.True, "Test Object should have Persisted Flag after adding to database..."); + Assert.That(obj.Dirty, Is.False, "Test Object should not be Dirty after adding to database..."); + Assert.That(obj.ObjectId, Is.EqualTo(objId), "Test Object should have kept its ObjectId from Creation..."); var retrieved = Database.FindObjectByKey(obj.ObjectId); - Assert.IsNotNull(retrieved, "Test Object previously added should be retrieved from database..."); - Assert.AreEqual(objId, retrieved.ObjectId, "Test Object previously added and retrieved object should have same ObjectId..."); - Assert.AreEqual(obj.TestField, retrieved.TestField, "Test Object previously added and retrieved object should have equals fields..."); + Assert.That(retrieved, Is.Not.Null, "Test Object previously added should be retrieved from database..."); + Assert.That(retrieved.ObjectId, Is.EqualTo(objId), "Test Object previously added and retrieved object should have same ObjectId..."); + Assert.That(retrieved.TestField, Is.EqualTo(obj.TestField), "Test Object previously added and retrieved object should have equals fields..."); } /// @@ -79,24 +79,24 @@ public void TestMultipleAddSameTable() foreach (var obj in objs) { - Assert.IsFalse(obj.IsPersisted, "Test Objects should not have Persisted Flag before adding..."); - Assert.IsTrue(obj.Dirty, "Test Objects should be Dirty before adding..."); + Assert.That(obj.IsPersisted, Is.False, "Test Objects should not have Persisted Flag before adding..."); + Assert.That(obj.Dirty, Is.True, "Test Objects should be Dirty before adding..."); } var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Test Objects should be inserted successfully, something went wrong..."); + Assert.That(inserted, Is.True, "Test Objects should be inserted successfully, something went wrong..."); foreach (var obj in objs) { - Assert.IsTrue(obj.IsPersisted, "Test Objects should have Persisted Flag after adding to database..."); - Assert.IsFalse(obj.Dirty, "Test Objects should not be Dirty after adding to database..."); + Assert.That(obj.IsPersisted, Is.True, "Test Objects should have Persisted Flag after adding to database..."); + Assert.That(obj.Dirty, Is.False, "Test Objects should not be Dirty after adding to database..."); } - CollectionAssert.AreEqual(objsId, objs.Select(obj => obj.ObjectId), "Test Objects should have kept their ObjectId from Creation..."); + Assert.That(objs.Select(obj => obj.ObjectId), Is.EqualTo(objsId), "Test Objects should have kept their ObjectId from Creation..."); var retrieved = Database.FindObjectsByKey(objsId); - Assert.IsNotNull(retrieved, "Test Objects retrieved Collection should not be null..."); - CollectionAssert.AreEqual(objsId, retrieved.Select(obj => obj.ObjectId), "Test Objects previously added and retrieved objects should have same ObjectId..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieved.Select(obj => obj.TestField), "Test Objects previously added and retrieved objects should have equals fields..."); + Assert.That(retrieved, Is.Not.Null, "Test Objects retrieved Collection should not be null..."); + Assert.That(retrieved.Select(obj => obj.ObjectId), Is.EqualTo(objsId), "Test Objects previously added and retrieved objects should have same ObjectId..."); + Assert.That(retrieved.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Test Objects previously added and retrieved objects should have equals fields..."); } /// @@ -129,53 +129,53 @@ public void TestMultipleAddDifferentTable() foreach (var obj in objs) { - Assert.IsFalse(obj.IsPersisted, "Different Test Objects should not have Persisted Flag before adding..."); - Assert.IsTrue(obj.Dirty, "Different Test Objects should be Dirty before adding..."); + Assert.That(obj.IsPersisted, Is.False, "Different Test Objects should not have Persisted Flag before adding..."); + Assert.That(obj.Dirty, Is.True, "Different Test Objects should be Dirty before adding..."); } var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Different Test Objects should be inserted successfully, something went wrong..."); + Assert.That(inserted, Is.True, "Different Test Objects should be inserted successfully, something went wrong..."); foreach (var obj in objs) { - Assert.IsTrue(obj.IsPersisted, "Test Objects should have Persisted Flag after adding to database..."); - Assert.IsFalse(obj.Dirty, "Test Objects should not be Dirty after adding to database..."); + Assert.That(obj.IsPersisted, Is.True, "Test Objects should have Persisted Flag after adding to database..."); + Assert.That(obj.Dirty, Is.False, "Test Objects should not be Dirty after adding to database..."); } foreach (var obj in objsTestTableRelations) { foreach (var ent in obj.Entries) { - Assert.IsTrue(ent.IsPersisted, "TestTableRelationEntries Objects should have Persisted Flag after adding to database..."); - Assert.IsFalse(ent.Dirty, "TestTableRelationEntries Objects should not be Dirty after adding to database..."); + Assert.That(ent.IsPersisted, Is.True, "TestTableRelationEntries Objects should have Persisted Flag after adding to database..."); + Assert.That(ent.Dirty, Is.False, "TestTableRelationEntries Objects should not be Dirty after adding to database..."); } } - CollectionAssert.AreEquivalent(objsTestTableId, objs.Where(obj => obj.GetType() == typeof(TestTable)).Select(obj => obj.ObjectId), "TestTable Objects should have kept their ObjectId from Creation..."); - CollectionAssert.AreEquivalent(objsTestTableRelationsId, objs.Where(obj => obj.GetType() == typeof(TestTableRelations)).Select(obj => obj.ObjectId), "TestTableRelations Objects should have kept their ObjectId from Creation..."); - CollectionAssert.AreNotEquivalent(objsTestTableAutoIncId, objs.Where(obj => obj.GetType() == typeof(TestTableAutoInc)).Select(obj => obj.ObjectId), "TestTableAutoInc Objects should NOT have kept their ObjectId from Creation..."); + Assert.That(objs.Where(obj => obj.GetType() == typeof(TestTable)).Select(obj => obj.ObjectId), Is.EquivalentTo(objsTestTableId), "TestTable Objects should have kept their ObjectId from Creation..."); + Assert.That(objs.Where(obj => obj.GetType() == typeof(TestTableRelations)).Select(obj => obj.ObjectId), Is.EquivalentTo(objsTestTableRelationsId), "TestTableRelations Objects should have kept their ObjectId from Creation..."); + Assert.That(objs.Where(obj => obj.GetType() == typeof(TestTableAutoInc)).Select(obj => obj.ObjectId), Is.Not.EquivalentTo(objsTestTableAutoIncId), "TestTableAutoInc Objects should NOT have kept their ObjectId from Creation..."); foreach (var obj in objs.Where(obj => obj.GetType() == typeof(TestTableRelations)).Cast()) - CollectionAssert.AreEquivalent(objsTestTableRelationsEntriesId[obj.ObjectId], obj.Entries.Select(ent => ent.ObjectId), + Assert.That(obj.Entries.Select(ent => ent.ObjectId), Is.EquivalentTo(objsTestTableRelationsEntriesId[obj.ObjectId]), "TestTableRelationsEntries Objects should have kept their ObjectId from Creation..."); var retrievedTestTable = Database.FindObjectsByKey(objsTestTableId); - Assert.IsNotNull(retrievedTestTable, "TestTable Objects retrieved Collection should not be null..."); - CollectionAssert.AreEqual(objsTestTableId, retrievedTestTable.Select(obj => obj.ObjectId), "TestTable Objects previously added and retrieved objects should have same ObjectId..."); - CollectionAssert.AreEqual(objsTestTable.Select(obj => obj.TestField), retrievedTestTable.Select(obj => obj.TestField), "TestTable Objects previously added and retrieved objects should have equals fields..."); + Assert.That(retrievedTestTable, Is.Not.Null, "TestTable Objects retrieved Collection should not be null..."); + Assert.That(retrievedTestTable.Select(obj => obj.ObjectId), Is.EqualTo(objsTestTableId), "TestTable Objects previously added and retrieved objects should have same ObjectId..."); + Assert.That(retrievedTestTable.Select(obj => obj.TestField), Is.EqualTo(objsTestTable.Select(obj => obj.TestField)), "TestTable Objects previously added and retrieved objects should have equals fields..."); var retrievedTestTableAutoInc = Database.FindObjectsByKey(objsTestTableAutoInc.Select(key => (object)key.PrimaryKey)); - Assert.IsNotNull(retrievedTestTableAutoInc, "TestTableAutoInc Objects retrieved Collection should not be null..."); - CollectionAssert.AreEqual(objsTestTableAutoInc.Select(key => key.PrimaryKey.ToString()), retrievedTestTableAutoInc.Select(obj => obj.ObjectId), "TestTableAutoInc Objects previously added and retrieved objects should have same ObjectId..."); - CollectionAssert.AreEqual(objsTestTableAutoInc.Select(obj => obj.TestField), retrievedTestTableAutoInc.Select(obj => obj.TestField), "TestTableAutoInc Objects previously added and retrieved objects should have equals fields..."); + Assert.That(retrievedTestTableAutoInc, Is.Not.Null, "TestTableAutoInc Objects retrieved Collection should not be null..."); + Assert.That(retrievedTestTableAutoInc.Select(obj => obj.ObjectId), Is.EqualTo(objsTestTableAutoInc.Select(key => key.PrimaryKey.ToString())), "TestTableAutoInc Objects previously added and retrieved objects should have same ObjectId..."); + Assert.That(retrievedTestTableAutoInc.Select(obj => obj.TestField), Is.EqualTo(objsTestTableAutoInc.Select(obj => obj.TestField)), "TestTableAutoInc Objects previously added and retrieved objects should have equals fields..."); var retrievedTestTableRelations = Database.FindObjectsByKey(objsTestTableRelationsId); - Assert.IsNotNull(retrievedTestTableRelations, "TestTableRelations Objects retrieved Collection should not be null..."); - CollectionAssert.AreEqual(objsTestTableRelationsId, retrievedTestTableRelations.Select(obj => obj.ObjectId), "TestTableRelations Objects previously added and retrieved objects should have same ObjectId..."); - CollectionAssert.AreEqual(objsTestTableRelations.Select(obj => obj.TestField), retrievedTestTableRelations.Select(obj => obj.TestField), "TestTableRelations Objects previously added and retrieved objects should have equals fields..."); + Assert.That(retrievedTestTableRelations, Is.Not.Null, "TestTableRelations Objects retrieved Collection should not be null..."); + Assert.That(retrievedTestTableRelations.Select(obj => obj.ObjectId), Is.EqualTo(objsTestTableRelationsId), "TestTableRelations Objects previously added and retrieved objects should have same ObjectId..."); + Assert.That(retrievedTestTableRelations.Select(obj => obj.TestField), Is.EqualTo(objsTestTableRelations.Select(obj => obj.TestField)), "TestTableRelations Objects previously added and retrieved objects should have equals fields..."); foreach (var obj in retrievedTestTableRelations) - CollectionAssert.AreEquivalent(objsTestTableRelationsEntriesId[obj.ObjectId], obj.Entries.Select(ent => ent.ObjectId), + Assert.That(obj.Entries.Select(ent => ent.ObjectId), Is.EquivalentTo(objsTestTableRelationsEntriesId[obj.ObjectId]), "TestTableRelationsEntries Objects previously added and retrieved objects should have same ObjectId..."); } @@ -197,8 +197,8 @@ public void TestSingleAddNonRegistered() { var dbo = new TableNotRegistered(); var added = Database.AddObject(dbo); - Assert.IsFalse(added, "Adding a Single non registered Object should not return success..."); - Assert.IsFalse(dbo.IsPersisted, "Adding a Single non registered Object should not have Persisted Flag..."); + Assert.That(added, Is.False, "Adding a Single non registered Object should not return success..."); + Assert.That(dbo.IsPersisted, Is.False, "Adding a Single non registered Object should not have Persisted Flag..."); } /// @@ -221,9 +221,9 @@ public void TestMultipleAddNonRegistered() Database.RegisterDataObject(typeof(TestTable)); var dbo = new DataObject[] { new TestTable { TestField = "Test Multiple Add with some non registered Values" }, new TableNotRegistered() }; var added = Database.AddObject(dbo); - Assert.IsFalse(added, "Adding Multiple non registered Object should not return success..."); - Assert.IsFalse(dbo[1].IsPersisted, "Adding a Multiple non registered Object should not have Persisted Flag on unregistered Object..."); - Assert.IsTrue(dbo[0].IsPersisted, "Adding a Multiple non registered Object should have Persisted Flag on registered Object..."); + Assert.That(added, Is.False, "Adding Multiple non registered Object should not return success..."); + Assert.That(dbo[1].IsPersisted, Is.False, "Adding a Multiple non registered Object should not have Persisted Flag on unregistered Object..."); + Assert.That(dbo[0].IsPersisted, Is.True, "Adding a Multiple non registered Object should have Persisted Flag on registered Object..."); } [Test, Explicit] @@ -237,9 +237,9 @@ public void BenchSingleAdd() Database.DeleteObject(Database.SelectAllObjects()); Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Database shouldn't have any record For TestTable."); - Assert.IsEmpty(Database.SelectAllObjects(), "Database shouldn't have any record For TestTable."); - Assert.IsEmpty(Database.SelectAllObjects(), "Database shouldn't have any record For TestTable."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Database shouldn't have any record For TestTable."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Database shouldn't have any record For TestTable."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Database shouldn't have any record For TestTable."); var objs = Enumerable.Range(0, 100).Select(i => new TestTable { TestField = string.Format("Bench Single Add '{0}'", i) }).ToArray(); @@ -280,9 +280,9 @@ public void BenchMultipleAdd() Database.DeleteObject(Database.SelectAllObjects()); Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Database shouldn't have any record For TestTable."); - Assert.IsEmpty(Database.SelectAllObjects(), "Database shouldn't have any record For TestTable."); - Assert.IsEmpty(Database.SelectAllObjects(), "Database shouldn't have any record For TestTable."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Database shouldn't have any record For TestTable."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Database shouldn't have any record For TestTable."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Database shouldn't have any record For TestTable."); var objs = Enumerable.Range(0, 100).Select(i => new TestTable { TestField = string.Format("Bench Multiple Add '{0}'", i) }).ToArray(); @@ -317,17 +317,17 @@ public void TestSingleSave() var inserted = Database.AddObject(obj); obj.TestField = "Test Single Save New Value"; - Assert.IsTrue(obj.Dirty, "Changing TestTable Object should set Dirty Flag..."); + Assert.That(obj.Dirty, Is.True, "Changing TestTable Object should set Dirty Flag..."); var saved = Database.SaveObject(obj); - Assert.IsTrue(saved, "Changed Object Should be Saved Successfully in database..."); - Assert.IsFalse(obj.Dirty, "Changed Object should not have Dirty flag after Saving..."); + Assert.That(saved, Is.True, "Changed Object Should be Saved Successfully in database..."); + Assert.That(obj.Dirty, Is.False, "Changed Object should not have Dirty flag after Saving..."); var retrieve = Database.FindObjectByKey(obj.ObjectId); - Assert.IsNotNull(retrieve, "Changed Object Should be retrieved from database..."); - Assert.AreEqual(obj.TestField, retrieve.TestField, "Previously Changed Object and newly retrieved Object should have the same field value..."); + Assert.That(retrieve, Is.Not.Null, "Changed Object Should be retrieved from database..."); + Assert.That(retrieve.TestField, Is.EqualTo(obj.TestField), "Previously Changed Object and newly retrieved Object should have the same field value..."); } /// @@ -345,19 +345,19 @@ public void TestMultipleSaveSameTable() { obj.TestField = string.Format("Test Multi Save Same Table Changed #{0}", current); current++; - Assert.IsTrue(obj.Dirty, "Changing TestTable Objects should set Dirty Flag..."); + Assert.That(obj.Dirty, Is.True, "Changing TestTable Objects should set Dirty Flag..."); } var saved = Database.SaveObject(objs); - Assert.IsTrue(saved, "Changed Objects Should be Saved Successfully in database..."); + Assert.That(saved, Is.True, "Changed Objects Should be Saved Successfully in database..."); foreach (var obj in objs) - Assert.IsFalse(obj.Dirty, "Changed Objects should not have Dirty flag after Saving..."); + Assert.That(obj.Dirty, Is.False, "Changed Objects should not have Dirty flag after Saving..."); var retrieved = Database.FindObjectsByKey(objs.Select(obj => obj.ObjectId)); - Assert.IsNotNull(retrieved, "Changed Objects Collection Should be retrieved from database..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.TestField), retrieved.Select(obj => obj.TestField), "Previously Changed Objects and newly retrieved Objects should have the same field value..."); + Assert.That(retrieved, Is.Not.Null, "Changed Objects Collection Should be retrieved from database..."); + Assert.That(retrieved.Select(obj => obj.TestField), Is.EquivalentTo(objs.Select(obj => obj.TestField)), "Previously Changed Objects and newly retrieved Objects should have the same field value..."); } /// @@ -389,7 +389,7 @@ public void TestMultipleSaveDifferentTable() { obj.TestField = string.Format("Test Multi Save Same Table Changed #{0}", current); current++; - Assert.IsTrue(obj.Dirty, "Changing TestTable Objects should set Dirty Flag..."); + Assert.That(obj.Dirty, Is.True, "Changing TestTable Objects should set Dirty Flag..."); } foreach (var obj in objsTestTableRelations) @@ -400,27 +400,27 @@ public void TestMultipleSaveDifferentTable() var saved = Database.SaveObject(objs); - Assert.IsTrue(saved, "Changed Objects Should be Saved Successfully in database..."); + Assert.That(saved, Is.True, "Changed Objects Should be Saved Successfully in database..."); foreach (var obj in objs) - Assert.IsFalse(obj.Dirty, "Changed Objects should not have Dirty flag after Saving..."); + Assert.That(obj.Dirty, Is.False, "Changed Objects should not have Dirty flag after Saving..."); foreach (var obj in objsTestTableRelations) { foreach (var ent in obj.Entries) - Assert.IsFalse(ent.Dirty, "Changed Objects Relations should not have Dirty flag after Saving..."); + Assert.That(ent.Dirty, Is.False, "Changed Objects Relations should not have Dirty flag after Saving..."); } var retrieved = Database.FindObjectsByKey(objsTestTable.Select(obj => obj.ObjectId)) .Concat(Database.FindObjectsByKey(objsTestTableAutoInc.Select(obj => obj.ObjectId))) .Concat(Database.FindObjectsByKey(objsTestTableRelations.Select(obj => obj.ObjectId))); - Assert.IsNotNull(retrieved, "Changed Objects Collection Should be retrieved from database..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.TestField), retrieved.Select(obj => obj.TestField), "Previously Changed Objects and newly retrieved Objects should have the same field value..."); + Assert.That(retrieved, Is.Not.Null, "Changed Objects Collection Should be retrieved from database..."); + Assert.That(retrieved.Select(obj => obj.TestField), Is.EquivalentTo(objs.Select(obj => obj.TestField)), "Previously Changed Objects and newly retrieved Objects should have the same field value..."); foreach (var obj in retrieved.Where(o => o.GetType() == typeof(TestTableRelations)).OfType()) { - CollectionAssert.AreEquivalent(objsTestTableRelations.First(o => o.ObjectId == obj.ObjectId).Entries.Select(o => o.ObjectId), - obj.Entries.Select(o => o.ObjectId), "Previously Changed Objects and newly retrieved Objects should have the same Relations Collections..."); + Assert.That(objsTestTableRelations.First(o => o.ObjectId == obj.ObjectId).Entries.Select(o => o.ObjectId), + Is.EquivalentTo(obj.Entries.Select(o => o.ObjectId)), "Previously Changed Objects and newly retrieved Objects should have the same Relations Collections..."); } } @@ -445,8 +445,8 @@ public void TestSingleSaveNonRegistered() DataObject obj = new TableNotRegistered(); obj.Dirty = true; var saved = Database.SaveObject(obj); - Assert.IsFalse(saved, "Trying to save a non registered object should not return success..."); - Assert.IsTrue(obj.Dirty, "Failing to save a non registered object should not remove Dirty Flag..."); + Assert.That(saved, Is.False, "Trying to save a non registered object should not return success..."); + Assert.That(obj.Dirty, Is.True, "Failing to save a non registered object should not remove Dirty Flag..."); } /// @@ -477,9 +477,9 @@ public void TestMultipleSaveNonRegistered() var saved = Database.SaveObject(dbo); - Assert.IsFalse(saved, "Saving Multiple non registered Object should not return success..."); - Assert.IsFalse(dbo[0].Dirty, "Saving a Collection with non registered Object should not have Dirty Flag on registered Object..."); - Assert.IsTrue(dbo[1].Dirty, "Saving a Collection with non registered Object should have Dirty Flag on non-registered Object..."); + Assert.That(saved, Is.False, "Saving Multiple non registered Object should not return success..."); + Assert.That(dbo[0].Dirty, Is.False, "Saving a Collection with non registered Object should not have Dirty Flag on registered Object..."); + Assert.That(dbo[1].Dirty, Is.True, "Saving a Collection with non registered Object should have Dirty Flag on non-registered Object..."); } #endregion @@ -494,16 +494,16 @@ public void TestSingleDelete() var obj = new TestTable { TestField = "Test Single Delete" }; var inserted = Database.AddObject(obj); - Assert.IsTrue(obj.IsPersisted, "Added Object should have Persisted Flag..."); + Assert.That(obj.IsPersisted, Is.True, "Added Object should have Persisted Flag..."); var deleted = Database.DeleteObject(obj); - Assert.IsTrue(deleted, "Added Object should be Successfully Deleted from database..."); - Assert.IsFalse(obj.IsPersisted, "Deleted Object should not have Persisted Flag"); - Assert.IsTrue(obj.IsDeleted, "Deleted Object should have Deleted Flag"); + Assert.That(deleted, Is.True, "Added Object should be Successfully Deleted from database..."); + Assert.That(obj.IsPersisted, Is.False, "Deleted Object should not have Persisted Flag"); + Assert.That(obj.IsDeleted, Is.True, "Deleted Object should have Deleted Flag"); var retrieve = Database.FindObjectByKey(obj.ObjectId); - Assert.IsNull(retrieve, "Retrieving Deleted Object should return null..."); + Assert.That(retrieve, Is.Null, "Retrieving Deleted Object should return null..."); } /// @@ -517,20 +517,20 @@ public void TestMultipleDeleteSameTable() var inserted = Database.AddObject(objs); foreach (var obj in objs) - Assert.IsTrue(obj.IsPersisted, "Added Objects should have Persisted Flag..."); + Assert.That(obj.IsPersisted, Is.True, "Added Objects should have Persisted Flag..."); var deleted = Database.DeleteObject(objs); - Assert.IsTrue(deleted, "Added Objects should be Successfully Deleted from database..."); + Assert.That(deleted, Is.True, "Added Objects should be Successfully Deleted from database..."); foreach (var obj in objs) { - Assert.IsFalse(obj.IsPersisted, "Deleted Objects should not have Persisted Flag"); - Assert.IsTrue(obj.IsDeleted, "Deleted Objects should have Deleted Flag"); + Assert.That(obj.IsPersisted, Is.False, "Deleted Objects should not have Persisted Flag"); + Assert.That(obj.IsDeleted, Is.True, "Deleted Objects should have Deleted Flag"); } var retrieve = Database.FindObjectsByKey(objs.Select(obj => obj.ObjectId)); - Assert.IsNotNull(retrieve, "Retrieving Deleted Objects Collection should not return null..."); - Assert.IsEmpty(retrieve.Where(obj => obj != null), "Retrieved Deleted Objects Collection should be empty..."); + Assert.That(retrieve, Is.Not.Null, "Retrieving Deleted Objects Collection should not return null..."); + Assert.That(retrieve.Where(obj => obj != null), Is.Empty, "Retrieved Deleted Objects Collection should be empty..."); } /// @@ -557,25 +557,25 @@ public void TestMultipleDeleteDifferentTable() var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Object Should be inserted to test Delete Cases..."); + Assert.That(inserted, Is.True, "Object Should be inserted to test Delete Cases..."); // Delete Objects var deleted = Database.DeleteObject(objs); - Assert.IsTrue(deleted, "Object should be deleted successfully..."); + Assert.That(deleted, Is.True, "Object should be deleted successfully..."); foreach (var obj in objs) { - Assert.IsTrue(obj.IsDeleted, "Deleted Objects should have Deleted Flag..."); - Assert.IsFalse(obj.IsPersisted, "Deleted Objects should not have Persisted Flag..."); + Assert.That(obj.IsDeleted, Is.True, "Deleted Objects should have Deleted Flag..."); + Assert.That(obj.IsPersisted, Is.False, "Deleted Objects should not have Persisted Flag..."); } foreach (var obj in objsTestTableRelations) { foreach (var ent in obj.Entries) { - Assert.IsTrue(ent.IsDeleted, "Deleted Objects should have Deleted Flag..."); - Assert.IsFalse(ent.IsPersisted, "Deleted Objects should not have Persisted Flag..."); + Assert.That(ent.IsDeleted, Is.True, "Deleted Objects should have Deleted Flag..."); + Assert.That(ent.IsPersisted, Is.False, "Deleted Objects should not have Persisted Flag..."); } } @@ -583,13 +583,13 @@ public void TestMultipleDeleteDifferentTable() .Concat(Database.FindObjectsByKey(objsTestTableAutoInc.Select(obj => obj.ObjectId))) .Concat(Database.FindObjectsByKey(objsTestTableRelations.Select(obj => obj.ObjectId))); - Assert.IsNotNull(retrieved, "Deleted Objects Collection Should be retrieved Empty not null from database..."); - Assert.IsEmpty(retrieved.Where(obj => obj != null), "Deleted Objects Collection Should be retrieved Empty from database..."); + Assert.That(retrieved, Is.Not.Null, "Deleted Objects Collection Should be retrieved Empty not null from database..."); + Assert.That(retrieved.Where(obj => obj != null), Is.Empty, "Deleted Objects Collection Should be retrieved Empty from database..."); var relRetrieved = Database.FindObjectsByKey(objsTestTableRelations.SelectMany(obj => obj.Entries).Select(ent => ent.ObjectId)); - Assert.IsNotNull(relRetrieved, "Deleted Objects Collection Should be retrieved Empty not null from database..."); - Assert.IsEmpty(relRetrieved.Where(obj => obj != null), "Deleted Objects Collection Should be retrieved Empty from database..."); + Assert.That(relRetrieved, Is.Not.Null, "Deleted Objects Collection Should be retrieved Empty not null from database..."); + Assert.That(relRetrieved.Where(obj => obj != null), Is.Empty, "Deleted Objects Collection Should be retrieved Empty from database..."); } /// @@ -612,8 +612,8 @@ public void TestSingleDeleteNonRegistered() { DataObject obj = new TableNotRegistered(); var deleted = Database.DeleteObject(obj); - Assert.IsFalse(deleted, "Trying to Delete a non registered object should not return success..."); - Assert.IsFalse(obj.IsDeleted, "Failing to Delete a non registered object should not set Deleted Flag..."); + Assert.That(deleted, Is.False, "Trying to Delete a non registered object should not return success..."); + Assert.That(obj.IsDeleted, Is.False, "Failing to Delete a non registered object should not set Deleted Flag..."); } /// @@ -641,9 +641,9 @@ public void TestMutipleDeleteNonRegistered() var deleted = Database.DeleteObject(dbo); - Assert.IsFalse(deleted, "Deleting Multiple non registered Object should not return success..."); - Assert.IsTrue(dbo[0].IsDeleted, "Deleting a Collection with non registered Object should set Deleted Flag on registered Object..."); - Assert.IsFalse(dbo[1].IsDeleted, "Deleting a Collection with non registered Object should not set Deleted Flag non-registered Object..."); + Assert.That(deleted, Is.False, "Deleting Multiple non registered Object should not return success..."); + Assert.That(dbo[0].IsDeleted, Is.True, "Deleting a Collection with non registered Object should set Deleted Flag on registered Object..."); + Assert.That(dbo[1].IsDeleted, Is.False, "Deleting a Collection with non registered Object should not set Deleted Flag non-registered Object..."); } #endregion @@ -661,19 +661,19 @@ public void TestSingleFindObjectByKey() var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "Find Object By Key Test Could not add object in database..."); + Assert.That(inserted, Is.True, "Find Object By Key Test Could not add object in database..."); var retrieve = Database.FindObjectByKey(obj.ObjectId); - Assert.IsNotNull(retrieve, "Find Object By Key Could not retrieve previously added Object..."); - Assert.AreEqual(obj.ObjectId, retrieve.ObjectId, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieve.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieve, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object..."); + Assert.That(retrieve.ObjectId, Is.EqualTo(obj.ObjectId), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieve.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); var retrieveCase = Database.FindObjectByKey(obj.ObjectId.ToUpper()); - Assert.IsNotNull(retrieveCase, "Find Object By Key Could not retrieve previously added Object using Case Mismatch..."); - Assert.AreEqual(obj.ObjectId, retrieveCase.ObjectId, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieveCase.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveCase, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object using Case Mismatch..."); + Assert.That(retrieveCase.ObjectId, Is.EqualTo(obj.ObjectId), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveCase.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); } /// @@ -688,21 +688,21 @@ public void TestMultipleFindObjectByKey() var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Find Object By Key Test Could not add objects in database..."); + Assert.That(inserted, Is.True, "Find Object By Key Test Could not add objects in database..."); var retrieve = Database.FindObjectsByKey(objs.Select(obj => obj.ObjectId)); - Assert.IsNotNull(retrieve, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieve.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.ObjectId), retrieve.Select(obj => obj.ObjectId), "Find Object By Key Should return similar Objects to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieve.Select(obj => obj.TestField), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieve, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieve.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects..."); + Assert.That(retrieve.Select(obj => obj.ObjectId), Is.EqualTo(objs.Select(obj => obj.ObjectId)), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieve.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Objects to created ones..."); var retrieveCase = Database.FindObjectsByKey(objs.Select(obj => obj.ObjectId.ToUpper())); - Assert.IsNotNull(retrieveCase, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieveCase.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects using Case Mismatch..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.ObjectId), retrieveCase.Select(obj => obj.ObjectId), "Find Object By Key Should return similar Objects to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieveCase.Select(obj => obj.TestField), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieveCase, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieveCase.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects using Case Mismatch..."); + Assert.That(retrieveCase.Select(obj => obj.ObjectId), Is.EqualTo(objs.Select(obj => obj.ObjectId)), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieveCase.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Objects to created ones..."); } /// @@ -717,19 +717,19 @@ public void TestSingleFindObjectByKeyPrimaryKey() var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "Find Object By Key Test Could not add object in database..."); + Assert.That(inserted, Is.True, "Find Object By Key Test Could not add object in database..."); var retrieve = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(retrieve, "Find Object By Key Could not retrieve previously added Object..."); - Assert.AreEqual(obj.PrimaryKey, retrieve.PrimaryKey, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieve.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieve, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object..."); + Assert.That(retrieve.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieve.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); var retrieveCase = Database.FindObjectByKey(obj.PrimaryKey.ToUpper()); - Assert.IsNotNull(retrieveCase, "Find Object By Key Could not retrieve previously added Object using Case Mismatch..."); - Assert.AreEqual(obj.PrimaryKey, retrieveCase.PrimaryKey, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieveCase.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveCase, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object using Case Mismatch..."); + Assert.That(retrieveCase.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveCase.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); } /// @@ -745,21 +745,21 @@ public void TestMultipleFindObjectByKeyPrimaryKey() var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Find Object By Key Test Could not add objects in database..."); + Assert.That(inserted, Is.True, "Find Object By Key Test Could not add objects in database..."); var retrieve = Database.FindObjectsByKey(objs.Select(obj => obj.PrimaryKey)); - Assert.IsNotNull(retrieve, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieve.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.PrimaryKey), retrieve.Select(obj => obj.PrimaryKey), "Find Object By Key Should return similar Objects to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieve.Select(obj => obj.TestField), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieve, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieve.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects..."); + Assert.That(retrieve.Select(obj => obj.PrimaryKey), Is.EqualTo(objs.Select(obj => obj.PrimaryKey)), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieve.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Objects to created ones..."); var retrieveCase = Database.FindObjectsByKey(objs.Select(obj => obj.PrimaryKey.ToUpper())); - Assert.IsNotNull(retrieveCase, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieveCase.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects using Case Mismatch..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.PrimaryKey), retrieveCase.Select(obj => obj.PrimaryKey), "Find Object By Key Should return similar Object to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieveCase.Select(obj => obj.TestField), "Find Object By Key Should return similar Object to created ones..."); + Assert.That(retrieveCase, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieveCase.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects using Case Mismatch..."); + Assert.That(retrieveCase.Select(obj => obj.PrimaryKey), Is.EqualTo(objs.Select(obj => obj.PrimaryKey)), "Find Object By Key Should return similar Object to created ones..."); + Assert.That(retrieveCase.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Object to created ones..."); } /// @@ -774,25 +774,25 @@ public void TestSingleFindObjectByKeyPrimaryKeyAutoInc() var inserted = Database.AddObject(obj); - Assert.IsTrue(inserted, "Find Object By Key Test Could not add object in database..."); + Assert.That(inserted, Is.True, "Find Object By Key Test Could not add object in database..."); var retrieve = Database.FindObjectByKey(obj.PrimaryKey); - Assert.IsNotNull(retrieve, "Find Object By Key Could not retrieve previously added Object..."); - Assert.AreEqual(obj.PrimaryKey, retrieve.PrimaryKey, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieve.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieve, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object..."); + Assert.That(retrieve.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieve.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); var retrieveCast = Database.FindObjectByKey((long)obj.PrimaryKey); - Assert.IsNotNull(retrieveCast, "Find Object By Key Could not retrieve previously added Object using Numeric Cast..."); - Assert.AreEqual(obj.PrimaryKey, retrieveCast.PrimaryKey, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieveCast.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveCast, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object using Numeric Cast..."); + Assert.That(retrieveCast.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveCast.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); var retrieveString = Database.FindObjectByKey(obj.PrimaryKey.ToString()); - Assert.IsNotNull(retrieveString, "Find Object By Key Could not retrieve previously added Object using String Cast..."); - Assert.AreEqual(obj.PrimaryKey, retrieveString.PrimaryKey, "Find Object By Key Should return similar Object to created one..."); - Assert.AreEqual(obj.TestField, retrieveString.TestField, "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveString, Is.Not.Null, "Find Object By Key Could not retrieve previously added Object using String Cast..."); + Assert.That(retrieveString.PrimaryKey, Is.EqualTo(obj.PrimaryKey), "Find Object By Key Should return similar Object to created one..."); + Assert.That(retrieveString.TestField, Is.EqualTo(obj.TestField), "Find Object By Key Should return similar Object to created one..."); } /// @@ -807,28 +807,28 @@ public void TestMultipleFindObjectByKeyPrimaryKeyAutoInc() var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Find Object By Key Test Could not add objects in database..."); + Assert.That(inserted, Is.True, "Find Object By Key Test Could not add objects in database..."); var retrieve = Database.FindObjectsByKey(objs.Select(obj => obj.PrimaryKey).Cast()); - Assert.IsNotNull(retrieve, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieve.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.PrimaryKey), retrieve.Select(obj => obj.PrimaryKey), "Find Object By Key Should return similar Objects to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieve.Select(obj => obj.TestField), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieve, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieve.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects..."); + Assert.That(retrieve.Select(obj => obj.PrimaryKey), Is.EqualTo(objs.Select(obj => obj.PrimaryKey)), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieve.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Objects to created ones..."); var retrieveCast = Database.FindObjectsByKey(objs.Select(obj => (long)obj.PrimaryKey).Cast()); - Assert.IsNotNull(retrieveCast, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieveCast.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects using Numeric Cast..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.PrimaryKey), retrieveCast.Select(obj => obj.PrimaryKey), "Find Object By Key Should return similar Objects to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieveCast.Select(obj => obj.TestField), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieveCast, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieveCast.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects using Numeric Cast..."); + Assert.That(retrieveCast.Select(obj => obj.PrimaryKey), Is.EqualTo(objs.Select(obj => obj.PrimaryKey)), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieveCast.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Objects to created ones..."); var retrieveString = Database.FindObjectsByKey(objs.Select(obj => obj.PrimaryKey.ToString())); - Assert.IsNotNull(retrieveString, "Find Object By Key Could should not return a null collection..."); - Assert.IsNotEmpty(retrieveString.Where(obj => obj != null), "Find Object By Key Could not retrieve previously added Objects using String Cast..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.PrimaryKey), retrieveString.Select(obj => obj.PrimaryKey), "Find Object By Key Should return similar Objects to created ones..."); - CollectionAssert.AreEqual(objs.Select(obj => obj.TestField), retrieveString.Select(obj => obj.TestField), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieveString, Is.Not.Null, "Find Object By Key Could should not return a null collection..."); + Assert.That(retrieveString.Where(obj => obj != null), Is.Not.Empty, "Find Object By Key Could not retrieve previously added Objects using String Cast..."); + Assert.That(retrieveString.Select(obj => obj.PrimaryKey), Is.EqualTo(objs.Select(obj => obj.PrimaryKey)), "Find Object By Key Should return similar Objects to created ones..."); + Assert.That(retrieveString.Select(obj => obj.TestField), Is.EqualTo(objs.Select(obj => obj.TestField)), "Find Object By Key Should return similar Objects to created ones..."); } /// @@ -841,7 +841,7 @@ public void TestSingleFindObjectByKeyWithNull() Database.RegisterDataObject(typeof(TestTable)); object key = null; var dbo = Database.FindObjectByKey(key); - Assert.IsNull(dbo, "Searching an Object By Key with a Null Key should return a null object..."); + Assert.That(dbo, Is.Null, "Searching an Object By Key with a Null Key should return a null object..."); } /// @@ -856,9 +856,9 @@ public void TestMultipleFindObjectByKeyWithNull() var dbo = new TestTable { TestField = "Test Searching Object by Key with some Null" }; Database.AddObject(dbo); var result = Database.FindObjectsByKey(new object[] { key, dbo.ObjectId }).ToArray(); - Assert.IsNotEmpty(result, "Searching with multiple keys including null shoud not return an empty collection..."); - Assert.IsNull(result[0], "Searching with multiple keys including null should return null data object for null key..."); - Assert.IsNotNull(result[1], "Searching with multiple keys including null should return a valid data object for non null key..."); + Assert.That(result, Is.Not.Empty, "Searching with multiple keys including null shoud not return an empty collection..."); + Assert.That(result[0], Is.Null, "Searching with multiple keys including null should return null data object for null key..."); + Assert.That(result[1], Is.Not.Null, "Searching with multiple keys including null should return a valid data object for non null key..."); } /// @@ -896,30 +896,30 @@ public void TestSelectObjects() var allobjects = Database.SelectAllObjects(); - Assert.IsNotEmpty(allobjects, "Select Objects Test Need some Data to be Accurate..."); + Assert.That(allobjects, Is.Not.Empty, "Select Objects Test Need some Data to be Accurate..."); var simpleWhere = Database.SelectObjects(DB.Column(nameof(TestTable.TestField)).IsEqualTo(objInitial.TestField)); - CollectionAssert.Contains(simpleWhere.Select(obj => obj.ObjectId), objInitial.ObjectId, "Select Objects with Simple Where clause should retrieve Object similar to Created one..."); + Assert.That(simpleWhere.Select(obj => obj.ObjectId), Has.Member(objInitial.ObjectId), "Select Objects with Simple Where clause should retrieve Object similar to Created one..."); var complexWhere = Database.SelectObjects(DB.Column(nameof(TestTable.TestField)).IsEqualTo(objInitial.TestField).And(DB.Column("Test_Table_ID").IsEqualTo(objInitial.ObjectId))); - CollectionAssert.Contains(complexWhere.Select(obj => obj.ObjectId.ToLower()), objInitial.ObjectId.ToLower(), "Select Objects with Complex Where clause should retrieve Object similar to Created one..."); + Assert.That(complexWhere.Select(obj => obj.ObjectId.ToLower()), Has.Member(objInitial.ObjectId.ToLower()), "Select Objects with Complex Where clause should retrieve Object similar to Created one..."); - Assert.IsTrue(Database.DeleteObject(Database.SelectObjects(DB.Column(nameof(TestTable.TestField)).IsNull()))); + Assert.That(Database.DeleteObject(Database.SelectObjects(DB.Column(nameof(TestTable.TestField)).IsNull())), Is.True); var objNull = new TestTable { TestField = null }; var nullAdd = Database.AddObject(objNull); - Assert.IsTrue(nullAdd, "Select Objects null parameter Test Need some null object to be Accurate..."); + Assert.That(nullAdd, Is.True, "Select Objects null parameter Test Need some null object to be Accurate..."); var nullParam = Database.SelectObjects(DB.Column(nameof(TestTable.TestField)).IsEqualTo(null)); - CollectionAssert.IsEmpty(nullParam, "Select Objects with Null Parameter Query should not return any record..."); + Assert.That(nullParam, Is.Empty, "Select Objects with Null Parameter Query should not return any record..."); var resultsWithTestfieldNull = Database.SelectObjects(DB.Column(nameof(TestTable.TestField)).IsNull()); var allObjectsAfter = Database.SelectAllObjects(); - Assert.AreEqual(1, resultsWithTestfieldNull.Count); + Assert.That(resultsWithTestfieldNull.Count, Is.EqualTo(1)); } [Test] @@ -931,7 +931,7 @@ public void SelectObjects_KeywordAsColumnName_SameAsAddedObjects() var result = Database.SelectObjects(DB.Column(nameof(SqlKeywordTable.Type)).IsEqualTo(firstEntry.Type)); - CollectionAssert.Contains(result.Select(obj => obj.ObjectId), firstEntry.ObjectId, "Select Objects with Simple Where clause should retrieve Object similar to Created one..."); + Assert.That(result.Select(obj => obj.ObjectId), Has.Member(firstEntry.ObjectId), "Select Objects with Simple Where clause should retrieve Object similar to Created one..."); } /// @@ -943,15 +943,15 @@ public void TestSelectObjectsWithMultipleWhereClause() Database.RegisterDataObject(typeof(TestTable)); var delete = Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsTrue(delete, "TestTable Objects should be deleted successfully..."); - Assert.IsEmpty(Database.SelectAllObjects(), "This test needs an Empty Table to Run Successfully..."); + Assert.That(delete, Is.True, "TestTable Objects should be deleted successfully..."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "This test needs an Empty Table to Run Successfully..."); var objs = new []{ "Test Select Group1", "Test Select Group2", "Test Select Group3", "Test Select Group4" } .Select(grp => Enumerable.Range(0, 100).Select(i => new TestTable { TestField = grp } )).ToDictionary(kv => kv.First().TestField, kv => kv.ToArray()); var added = Database.AddObject(objs.SelectMany(obj => obj.Value)); - Assert.IsTrue(added, "TestTable Objects should be added successfully..."); + Assert.That(added, Is.True, "TestTable Objects should be added successfully..."); var parameters = new[] { "Test Select Group1", "Test Select Group2", "Test Select Group3", "Test Select Group4" }; var retrieve = Database.MultipleSelectObjects(parameters.Select(parameter => DB.Column(nameof(TestTable.TestField)).IsEqualTo(parameter))); @@ -959,15 +959,15 @@ public void TestSelectObjectsWithMultipleWhereClause() var objectByGroup = new []{ "Test Select Group1", "Test Select Group2", "Test Select Group3", "Test Select Group4" } .Select((grp, index) => new { Grp = grp, Objects = retrieve.ElementAt(index) }); - Assert.IsNotNull(retrieve, "Retrieve Sets from Select Objects should not return null value..."); - Assert.IsNotEmpty(retrieve, "Retrieve Set from Select Objects should not be Empty..."); + Assert.That(retrieve, Is.Not.Null, "Retrieve Sets from Select Objects should not return null value..."); + Assert.That(retrieve, Is.Not.Empty, "Retrieve Set from Select Objects should not be Empty..."); foreach (var sets in objectByGroup) { - Assert.IsNotEmpty(sets.Objects, "Retrieve SubSets from Select Objects should not be Empty..."); - Assert.IsTrue(sets.Objects.All(obj => obj.TestField.Equals(sets.Grp, StringComparison.OrdinalIgnoreCase)), + Assert.That(sets.Objects, Is.Not.Empty, "Retrieve SubSets from Select Objects should not be Empty..."); + Assert.That(sets.Objects.All(obj => obj.TestField.Equals(sets.Grp, StringComparison.OrdinalIgnoreCase)), Is.True, "Retrieve SubSets from Select Objects should have the Where Clause Matching their Field Value..."); - CollectionAssert.AreEquivalent(objs[sets.Grp].Select(obj => obj.ObjectId), sets.Objects.Select(obj => obj.ObjectId), + Assert.That(sets.Objects.Select(obj => obj.ObjectId), Is.EquivalentTo(objs[sets.Grp].Select(obj => obj.ObjectId)), "Retrieve SubSets from Select Objects should return the same ObjectId Sets as Created..."); } @@ -975,13 +975,13 @@ public void TestSelectObjectsWithMultipleWhereClause() var orderedObjs = objs.SelectMany(obj => obj.Value).ToArray(); var retrieveMany = Database.MultipleSelectObjects(orderedObjs.Select(obj => DB.Column(nameof(TestTable.TestField)).IsEqualTo(obj.TestField).And(DB.Column("Test_Table_ID").IsEqualTo(obj.ObjectId)))); - Assert.IsNotNull(retrieveMany, "Retrieve Sets from Select Objects should not return null value..."); - Assert.IsNotEmpty(retrieveMany, "Retrieve Set from Select Objects should not be Empty..."); + Assert.That(retrieveMany, Is.Not.Null, "Retrieve Sets from Select Objects should not return null value..."); + Assert.That(retrieveMany, Is.Not.Empty, "Retrieve Set from Select Objects should not be Empty..."); var resultsMany = retrieveMany.Select(obj => obj.Single()); - CollectionAssert.AreEqual(orderedObjs.Select(obj => obj.ObjectId.ToLower()), resultsMany.Select(obj => obj.ObjectId.ToLower()), + Assert.That(resultsMany.Select(obj => obj.ObjectId.ToLower()), Is.EqualTo(orderedObjs.Select(obj => obj.ObjectId.ToLower())), "Retrieve Sets from Select Objects should be Equal to Parameter Set ObjectId..."); - CollectionAssert.AreEqual(orderedObjs.Select(obj => obj.TestField.ToLower()), resultsMany.Select(obj => obj.TestField.ToLower()), + Assert.That(resultsMany.Select(obj => obj.TestField.ToLower()), Is.EqualTo(orderedObjs.Select(obj => obj.TestField.ToLower())), "Retrieve Sets from Select Objects should be Equal to Parameter Set Field Value..."); var parameterManyWithMissing = new [] { ("No Known Value", "Probably Nothing"),("Absolutely None","Nothing for Sure")} @@ -989,13 +989,13 @@ public void TestSelectObjectsWithMultipleWhereClause() var manyQueriesWithMissing = parameterManyWithMissing.Select(tuple => DB.Column(nameof(TestTable.TestField)).IsEqualTo(tuple.Item1).And(DB.Column("Test_Table_ID").IsEqualTo(tuple.Item2))); var retrieveManyWithMissing = Database.MultipleSelectObjects(manyQueriesWithMissing); - Assert.IsNotNull(retrieveManyWithMissing, "Retrieve Sets from Select Objects should not return null value..."); - Assert.IsNotEmpty(retrieveManyWithMissing, "Retrieve Set from Select Objects should not be Empty..."); + Assert.That(retrieveManyWithMissing, Is.Not.Null, "Retrieve Sets from Select Objects should not return null value..."); + Assert.That(retrieveManyWithMissing, Is.Not.Empty, "Retrieve Set from Select Objects should not be Empty..."); var resultsManyWithMissing = retrieveManyWithMissing.Select(obj => obj.SingleOrDefault()); - CollectionAssert.AreEqual(new [] { "", "" }.Concat(orderedObjs.Select(obj => obj.ObjectId.ToLower())), resultsManyWithMissing.Select(obj => obj != null ? obj.ObjectId.ToLower() : string.Empty), + Assert.That(resultsManyWithMissing.Select(obj => obj != null ? obj.ObjectId.ToLower() : string.Empty), Is.EqualTo(new [] { "", "" }.Concat(orderedObjs.Select(obj => obj.ObjectId.ToLower()))), "Retrieve Sets from Select Objects should be Equal to Parameter Set ObjectId..."); - CollectionAssert.AreEqual(new [] { "", "" }.Concat(orderedObjs.Select(obj => obj.TestField.ToLower())), resultsManyWithMissing.Select(obj => obj != null ? obj.TestField.ToLower() : string.Empty), + Assert.That(resultsManyWithMissing.Select(obj => obj != null ? obj.TestField.ToLower() : string.Empty), Is.EqualTo(new [] { "", "" }.Concat(orderedObjs.Select(obj => obj.TestField.ToLower()))), "Retrieve Sets from Select Objects should be Equal to Parameter Set Field Value..."); @@ -1025,15 +1025,15 @@ public void TestSelectObjectsWithNull() Database.RegisterDataObject(typeof(TestTable)); var delete = Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsTrue(delete, "TestTable Objects should be deleted successfully..."); - Assert.IsEmpty(Database.SelectAllObjects(), "This test needs an Empty Table to Run Successfully..."); + Assert.That(delete, Is.True, "TestTable Objects should be deleted successfully..."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "This test needs an Empty Table to Run Successfully..."); var objInitial = Enumerable.Range(0, 10).Select(i => new TestTable { TestField = string.Format("Select Objects Null Values Test #{0}", i) }); Database.AddObject(objInitial); var allobjects = Database.SelectAllObjects(); - Assert.IsNotEmpty(allobjects, "This Test Need some Data to be Accurate..."); + Assert.That(allobjects, Is.Not.Empty, "This Test Need some Data to be Accurate..."); Assert.Throws(typeof(NullReferenceException), () => Database.SelectObject((WhereClause)null), ""); Assert.Throws(typeof(NullReferenceException), () => Database.SelectObjects((WhereClause)null), ""); @@ -1053,26 +1053,26 @@ public void TestSelectAll() var objs = Database.SelectAllObjects(); - Assert.IsNotNull(objs, "Retrieving from a Registered Table should not return null..."); + Assert.That(objs, Is.Not.Null, "Retrieving from a Registered Table should not return null..."); var delete = Database.DeleteObject(objs); - Assert.IsTrue(delete, "TestTable Objects should be deleted successfully..."); + Assert.That(delete, Is.True, "TestTable Objects should be deleted successfully..."); objs = Database.SelectAllObjects(); - Assert.IsNotNull(objs, "TestTable Select All from an Empty table should not return null..."); - Assert.IsEmpty(objs, "TestTable Select All from an Empty table should return an Empty Collection..."); + Assert.That(objs, Is.Not.Null, "TestTable Select All from an Empty table should not return null..."); + Assert.That(objs, Is.Empty, "TestTable Select All from an Empty table should return an Empty Collection..."); objs = Enumerable.Range(0, 10).Select(i => new TestTable { TestField = string.Format("Test Select All Object #{0}", i) }).ToList(); var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "TestTable Objects should be inserted successfully..."); + Assert.That(inserted, Is.True, "TestTable Objects should be inserted successfully..."); var retrieve = Database.SelectAllObjects(); - Assert.IsNotEmpty(retrieve, "TestTable Objects Select All should return previously inserted objects..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.ObjectId), retrieve.Select(obj => obj.ObjectId), "TestTable Select All should return Objects with Same ID as Inserted..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.TestField), retrieve.Select(obj => obj.TestField), "TestTable Select All shoud return Objects with same Value Field as Inserted..."); + Assert.That(retrieve, Is.Not.Empty, "TestTable Objects Select All should return previously inserted objects..."); + Assert.That(retrieve.Select(obj => obj.ObjectId), Is.EquivalentTo(objs.Select(obj => obj.ObjectId)), "TestTable Select All should return Objects with Same ID as Inserted..."); + Assert.That(retrieve.Select(obj => obj.TestField), Is.EquivalentTo(objs.Select(obj => obj.TestField)), "TestTable Select All shoud return Objects with same Value Field as Inserted..."); } /// @@ -1099,7 +1099,7 @@ public void TestCountObject() var count = Database.GetObjectCount(); - Assert.AreEqual(0, count, "Test Table shouldn't Have any Object after deleting all records..."); + Assert.That(count, Is.EqualTo(0), "Test Table shouldn't Have any Object after deleting all records..."); var objs = Enumerable.Range(0, 10).Select(i => new TestTable { TestField = string.Format("Count Object Test #{0}", i) }); @@ -1107,15 +1107,15 @@ public void TestCountObject() var newCount = Database.GetObjectCount(); - Assert.AreEqual(10, newCount, "Test Table should return same object count as added collection..."); + Assert.That(newCount, Is.EqualTo(10), "Test Table should return same object count as added collection..."); var whereCount = Database.GetObjectCount("1"); - Assert.AreEqual(10, whereCount, "Test Table should return same object count as added collection..."); + Assert.That(whereCount, Is.EqualTo(10), "Test Table should return same object count as added collection..."); var filterCount = Database.GetObjectCount("`TestField` LIKE '%1'"); - Assert.AreEqual(1, filterCount, "Test Table should return same object count as filtered collection..."); + Assert.That(filterCount, Is.EqualTo(1), "Test Table should return same object count as filtered collection..."); } /// @@ -1131,7 +1131,7 @@ public void TestCountObjectWithNull() var count = Database.GetObjectCount(null); - Assert.AreEqual(0, count, "Test Table shouldn't Have any Object after deleting all records..."); + Assert.That(count, Is.EqualTo(0), "Test Table shouldn't Have any Object after deleting all records..."); var objs = Enumerable.Range(0, 10).Select(i => new TestTable { TestField = string.Format("Count Object Test #{0}", i) }); @@ -1139,7 +1139,7 @@ public void TestCountObjectWithNull() var newCount = Database.GetObjectCount(null); - Assert.AreEqual(10, newCount, "Test Table should return same object count as added collection..."); + Assert.That(newCount, Is.EqualTo(10), "Test Table should return same object count as added collection..."); } /// @@ -1163,7 +1163,7 @@ public virtual void TestEscape() { var test = "'"; - Assert.AreEqual("''", Database.Escape(test), "Sqlite String Escape Test Failure..."); + Assert.That(Database.Escape(test), Is.EqualTo("''"), "Sqlite String Escape Test Failure..."); } /// diff --git a/Tests/IntegrationTests/Database/MYSQLDBRegisterTableTests.cs b/Tests/IntegrationTests/Database/MYSQLDBRegisterTableTests.cs index fb91ecc8a4..aac796e13d 100644 --- a/Tests/IntegrationTests/Database/MYSQLDBRegisterTableTests.cs +++ b/Tests/IntegrationTests/Database/MYSQLDBRegisterTableTests.cs @@ -55,7 +55,7 @@ public void TestTableWithBrokenPrimaryKey() new TestTableWithBrokenPrimaryV2 { PrimaryKey = 1 }, }); - Assert.IsFalse(adds, "Primary Key was not restored and duplicate key were inserted !"); + Assert.That(adds, Is.False, "Primary Key was not restored and duplicate key were inserted !"); } } } diff --git a/Tests/IntegrationTests/Database/MySQLDBInterfaceTests.cs b/Tests/IntegrationTests/Database/MySQLDBInterfaceTests.cs index da02eb9da1..7c8d5ef126 100644 --- a/Tests/IntegrationTests/Database/MySQLDBInterfaceTests.cs +++ b/Tests/IntegrationTests/Database/MySQLDBInterfaceTests.cs @@ -33,7 +33,7 @@ public override void TestEscape() { var test = "\\\"'’"; - Assert.AreEqual("\\\\\\\"\\'\\’", Database.Escape(test), "MySQL String Escape Test Failure..."); + Assert.That(Database.Escape(test), Is.EqualTo("\\\\\\\"\\'\\’"), "MySQL String Escape Test Failure..."); } } } diff --git a/Tests/IntegrationTests/Database/RegisterTableTests.cs b/Tests/IntegrationTests/Database/RegisterTableTests.cs index 5b3edad017..9d2b71f6b2 100644 --- a/Tests/IntegrationTests/Database/RegisterTableTests.cs +++ b/Tests/IntegrationTests/Database/RegisterTableTests.cs @@ -65,7 +65,7 @@ public void TestAllAvailableTables() var selectall = typeof(IObjectDatabase).GetMethod("SelectAllObjects", Array.Empty() ).MakeGenericMethod(type); object objs = null; Assert.DoesNotThrow( () => { objs = selectall.Invoke(Database, Array.Empty() ); }, "Registered tables should not Throw Exception on Select All... (Failed on Type {0})", type); - Assert.IsNotNull(objs); + Assert.That(objs, Is.Not.Null); } } } @@ -109,22 +109,22 @@ public void TestTableMigrationFromNoPrimaryKeyToAutoInc() Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Test Table TestTableWithNoPrimaryV1 should be empty to begin this tests."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Test Table TestTableWithNoPrimaryV1 should be empty to begin this tests."); var objs = new [] { "TestObj1", "TestObj2", "TestObj3" }.Select(ent => new TestTableWithNoPrimaryV1 { Value = ent }).ToArray(); Database.AddObject(objs); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.Value), Database.SelectAllObjects().Select(obj => obj.Value), "Test Table TestTableWithNoPrimaryV1 Entries should be available for this test to run."); + Assert.That(Database.SelectAllObjects().Select(obj => obj.Value), Is.EquivalentTo(objs.Select(obj => obj.Value)), "Test Table TestTableWithNoPrimaryV1 Entries should be available for this test to run."); // Trigger False Migration DatabaseV2.RegisterDataObject(typeof(TestTableWithNoPrimaryV2)); var newObjs = DatabaseV2.SelectAllObjects().ToArray(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.Value), newObjs.Select(obj => obj.Value), "Test Table Migration to TestTableWithNoPrimaryV2 should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => obj.Value), Is.EquivalentTo(objs.Select(obj => obj.Value)), "Test Table Migration to TestTableWithNoPrimaryV2 should retrieve similar values that created ones..."); - Assert.IsTrue(newObjs.All(obj => obj.PrimaryKey != 0), "Test Table Migration to TestTableWithNoPrimaryV2 should have created and populated Primary Key Auto Increment."); + Assert.That(newObjs.All(obj => obj.PrimaryKey != 0), Is.True, "Test Table Migration to TestTableWithNoPrimaryV2 should have created and populated Primary Key Auto Increment."); // Trigger Another Migration DatabaseV2 = GetDatabaseV2; @@ -132,9 +132,9 @@ public void TestTableMigrationFromNoPrimaryKeyToAutoInc() var newerObjs = DatabaseV2.SelectAllObjects().ToArray(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.Value), newerObjs.Select(obj => obj.Value), "Test Table Migration to TestTableWithNoPrimaryV3 should retrieve similar values that created ones..."); + Assert.That(newerObjs.Select(obj => obj.Value), Is.EquivalentTo(objs.Select(obj => obj.Value)), "Test Table Migration to TestTableWithNoPrimaryV3 should retrieve similar values that created ones..."); - Assert.IsTrue(newerObjs.All(obj => obj.PrimaryKey2 != 0), "Test Table Migration to TestTableWithNoPrimaryV3 should have created and populated Primary Key Auto Increment."); + Assert.That(newerObjs.All(obj => obj.PrimaryKey2 != 0), Is.True, "Test Table Migration to TestTableWithNoPrimaryV3 should have created and populated Primary Key Auto Increment."); } @@ -154,7 +154,7 @@ public void TestTableMigrationWithDifferentTypes() Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Test Table TestTableDifferentTypesV1 should be empty to begin this tests."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Test Table TestTableDifferentTypesV1 should be empty to begin this tests."); var datenow = DateTime.UtcNow; var now = new DateTime(datenow.Year, datenow.Month, datenow.Day, datenow.Hour, datenow.Minute, datenow.Second); @@ -162,16 +162,16 @@ public void TestTableMigrationWithDifferentTypes() Database.AddObject(objs); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.StringValue), Database.SelectAllObjects().Select(obj => obj.StringValue), "Test Table TestTableDifferentTypesV1 Entries should be available for this test to run."); + Assert.That(Database.SelectAllObjects().Select(obj => obj.StringValue), Is.EquivalentTo(objs.Select(obj => obj.StringValue)), "Test Table TestTableDifferentTypesV1 Entries should be available for this test to run."); // Trigger False Migration DatabaseV2.RegisterDataObject(typeof(TestTableDifferentTypesV2)); var newObjs = DatabaseV2.SelectAllObjects().ToArray(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.StringValue), newObjs.Select(obj => obj.StringValue), "Test Table Migration to TestTableDifferentTypesV2 should retrieve similar values that created ones..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.IntValue), newObjs.Select(obj => obj.IntValue), "Test Table Migration to TestTableDifferentTypesV2 should retrieve similar values that created ones..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.DateValue), newObjs.Select(obj => Convert.ToDateTime(obj.DateValue)), "Test Table Migration to TestTableDifferentTypesV2 should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => obj.StringValue), Is.EquivalentTo(objs.Select(obj => obj.StringValue)), "Test Table Migration to TestTableDifferentTypesV2 should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => obj.IntValue), Is.EquivalentTo(objs.Select(obj => obj.IntValue)), "Test Table Migration to TestTableDifferentTypesV2 should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => Convert.ToDateTime(obj.DateValue)), Is.EquivalentTo(objs.Select(obj => obj.DateValue)), "Test Table Migration to TestTableDifferentTypesV2 should retrieve similar values that created ones..."); // Trigger another Migraiton DatabaseV2 = GetDatabaseV2; @@ -179,9 +179,9 @@ public void TestTableMigrationWithDifferentTypes() var newerObjs = DatabaseV2.SelectAllObjects().ToArray(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.StringValue), newerObjs.Select(obj => obj.StringValue), "Test Table Migration to TestTableDifferentTypesV1 should retrieve similar values that created ones..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.IntValue), newerObjs.Select(obj => obj.IntValue), "Test Table Migration to TestTableDifferentTypesV1 should retrieve similar values that created ones..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.DateValue), newerObjs.Select(obj => obj.DateValue), "Test Table Migration to TestTableDifferentTypesV1 should retrieve similar values that created ones..."); + Assert.That(newerObjs.Select(obj => obj.StringValue), Is.EquivalentTo(objs.Select(obj => obj.StringValue)), "Test Table Migration to TestTableDifferentTypesV1 should retrieve similar values that created ones..."); + Assert.That(newerObjs.Select(obj => obj.IntValue), Is.EquivalentTo(objs.Select(obj => obj.IntValue)), "Test Table Migration to TestTableDifferentTypesV1 should retrieve similar values that created ones..."); + Assert.That(newerObjs.Select(obj => obj.DateValue), Is.EquivalentTo(objs.Select(obj => obj.DateValue)), "Test Table Migration to TestTableDifferentTypesV1 should retrieve similar values that created ones..."); } /// @@ -193,7 +193,7 @@ public void TestTablePrecachedUpdateCache() Database.RegisterDataObject(typeof(TestTablePrecachedPrimaryKey)); Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Test Precached Table with Update Cache need Empty table to begin tests."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Test Precached Table with Update Cache need Empty table to begin tests."); // Get a new Database Object to Trigger Cache Invalidation var DatabaseV2 = GetDatabaseV2; @@ -205,17 +205,17 @@ public void TestTablePrecachedUpdateCache() var inserted = Database.AddObject(objs); - Assert.IsTrue(inserted, "Test Precached Table with Update Cache could not insert test objects."); + Assert.That(inserted, Is.True, "Test Precached Table with Update Cache could not insert test objects."); var update = DatabaseV2.UpdateObjsInCache(objs.Select(o => o.PrimaryKey)); - Assert.IsTrue(update, "Test Precached Table with Update Cache could not refresh newly inserted objects."); + Assert.That(update, Is.True, "Test Precached Table with Update Cache could not refresh newly inserted objects."); var retrieve = DatabaseV2.SelectAllObjects(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.PrimaryKey), retrieve.Select(obj => obj.PrimaryKey), "Test Precached Table with Update Cache should return similar objets than created ones."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.TestField), retrieve.Select(obj => obj.TestField), "Test Precached Table with Update Cache should return similar objets than created ones."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.PrecachedValue), retrieve.Select(obj => obj.PrecachedValue), "Test Precached Table with Update Cache should return similar objets than created ones."); + Assert.That(retrieve.Select(obj => obj.PrimaryKey), Is.EquivalentTo(objs.Select(obj => obj.PrimaryKey)), "Test Precached Table with Update Cache should return similar objets than created ones."); + Assert.That(retrieve.Select(obj => obj.TestField), Is.EquivalentTo(objs.Select(obj => obj.TestField)), "Test Precached Table with Update Cache should return similar objets than created ones."); + Assert.That(retrieve.Select(obj => obj.PrecachedValue), Is.EquivalentTo(objs.Select(obj => obj.PrecachedValue)), "Test Precached Table with Update Cache should return similar objets than created ones."); // Modify foreach (var obj in retrieve) @@ -226,24 +226,24 @@ public void TestTablePrecachedUpdateCache() var saved = DatabaseV2.SaveObject(retrieve); - Assert.IsTrue(saved, "Test Precached Table with Update Cache could not modify objects in database."); + Assert.That(saved, Is.True, "Test Precached Table with Update Cache could not modify objects in database."); var retrievecached = Database.FindObjectsByKey(objs.Select(obj => obj.PrimaryKey)); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.PrimaryKey), retrievecached.Select(obj => obj.PrimaryKey), "Test Precached Table with Update Cache should return similar cached objets than created ones."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.TestField), retrievecached.Select(obj => obj.TestField), "Test Precached Table with Update Cache should return similar cached objets than created ones."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.PrecachedValue), retrievecached.Select(obj => obj.PrecachedValue), "Test Precached Table with Update Cache should return similar cached objets than created ones."); + Assert.That(retrievecached.Select(obj => obj.PrimaryKey), Is.EquivalentTo(objs.Select(obj => obj.PrimaryKey)), "Test Precached Table with Update Cache should return similar cached objets than created ones."); + Assert.That(retrievecached.Select(obj => obj.TestField), Is.EquivalentTo(objs.Select(obj => obj.TestField)), "Test Precached Table with Update Cache should return similar cached objets than created ones."); + Assert.That(retrievecached.Select(obj => obj.PrecachedValue), Is.EquivalentTo(objs.Select(obj => obj.PrecachedValue)), "Test Precached Table with Update Cache should return similar cached objets than created ones."); // update var updated = Database.UpdateObjsInCache(objs.Select(obj => obj.PrimaryKey)); - Assert.IsTrue(updated, "Test Precached Table with Update Cache could not update objects cache from database."); + Assert.That(updated, Is.True, "Test Precached Table with Update Cache could not update objects cache from database."); var retrieveupdated = Database.FindObjectsByKey(objs.Select(obj => obj.PrimaryKey)); - CollectionAssert.AreEquivalent(retrieve.Select(obj => obj.PrimaryKey), retrieveupdated.Select(obj => obj.PrimaryKey), "Test Precached Table with Update Cache should return similar updated objets than modified ones."); - CollectionAssert.AreEquivalent(retrieve.Select(obj => obj.TestField), retrieveupdated.Select(obj => obj.TestField), "Test Precached Table with Update Cache should return similar updated objets than modified ones."); - CollectionAssert.AreEquivalent(retrieve.Select(obj => obj.PrecachedValue), retrieveupdated.Select(obj => obj.PrecachedValue), "Test Precached Table with Update Cache should return similar updated objets than modified ones."); + Assert.That(retrieveupdated.Select(obj => obj.PrimaryKey), Is.EquivalentTo(retrieve.Select(obj => obj.PrimaryKey)), "Test Precached Table with Update Cache should return similar updated objets than modified ones."); + Assert.That(retrieveupdated.Select(obj => obj.TestField), Is.EquivalentTo(retrieve.Select(obj => obj.TestField)), "Test Precached Table with Update Cache should return similar updated objets than modified ones."); + Assert.That(retrieveupdated.Select(obj => obj.PrecachedValue), Is.EquivalentTo(retrieve.Select(obj => obj.PrecachedValue)), "Test Precached Table with Update Cache should return similar updated objets than modified ones."); } /// @@ -262,21 +262,21 @@ public void TestTableMigrationChangingPrimaryKey() Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Test Table TestTableWithPrimaryChangingV1 should be empty to begin this tests."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Test Table TestTableWithPrimaryChangingV1 should be empty to begin this tests."); var objs = new [] { "TestObj1", "TestObj2", "TestObj3" }.Select((ent, i) => new TestTableWithPrimaryChangingV1 { PrimaryKey = i, Value = ent }).ToArray(); Database.AddObject(objs); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.Value), Database.SelectAllObjects().Select(obj => obj.Value), "Test Table TestTableWithPrimaryChangingV1 Entries should be available for this test to run."); + Assert.That(Database.SelectAllObjects().Select(obj => obj.Value), Is.EquivalentTo(objs.Select(obj => obj.Value)), "Test Table TestTableWithPrimaryChangingV1 Entries should be available for this test to run."); // Trigger False Migration DatabaseV2.RegisterDataObject(typeof(TestTableWithPrimaryChangingV2)); var newObjs = DatabaseV2.SelectAllObjects().ToArray(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.Value), newObjs.Select(obj => obj.Value), "Test Table Migration to TestTableWithPrimaryChangingV2 should retrieve similar values that created ones..."); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.PrimaryKey), newObjs.Select(obj => obj.PrimaryKey), "Test Table Migration to TestTableWithPrimaryChangingV2 should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => obj.Value), Is.EquivalentTo(objs.Select(obj => obj.Value)), "Test Table Migration to TestTableWithPrimaryChangingV2 should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => obj.PrimaryKey), Is.EquivalentTo(objs.Select(obj => obj.PrimaryKey)), "Test Table Migration to TestTableWithPrimaryChangingV2 should retrieve similar values that created ones..."); } [Test] @@ -292,21 +292,21 @@ public void TestTableMigrationToNonNullValue() Database.DeleteObject(Database.SelectAllObjects()); - Assert.IsEmpty(Database.SelectAllObjects(), "Test Table TestTableMigrationNullToNonNull should be empty to begin this tests."); + Assert.That(Database.SelectAllObjects(), Is.Empty, "Test Table TestTableMigrationNullToNonNull should be empty to begin this tests."); var objs = new [] { "TestObj1", null, "TestObj3" }.Select((ent, i) => new TestTableMigrationNullToNonNull { StringValue = ent }).ToArray(); Database.AddObject(objs); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.StringValue), Database.SelectAllObjects().Select(obj => obj.StringValue), "Test Table TestTableMigrationNullToNonNull Entries should be available for this test to run."); + Assert.That(Database.SelectAllObjects().Select(obj => obj.StringValue), Is.EquivalentTo(objs.Select(obj => obj.StringValue)), "Test Table TestTableMigrationNullToNonNull Entries should be available for this test to run."); // Trigger False Migration DatabaseV2.RegisterDataObject(typeof(TestTableMigrationNullFromNull)); var newObjs = DatabaseV2.SelectAllObjects().ToArray(); - CollectionAssert.AreEquivalent(objs.Select(obj => obj.StringValue ?? string.Empty), newObjs.Select(obj => obj.StringValue), "Test Table Migration to TestTableMigrationNullFromNull should retrieve similar values that created ones..."); - CollectionAssert.AreEqual(Enumerable.Repeat(0, 3), newObjs.Select(obj => obj.IntValue), "Test Table Migration to TestTableMigrationNullFromNull should retrieve all default int value to 0..."); + Assert.That(newObjs.Select(obj => obj.StringValue), Is.EquivalentTo(objs.Select(obj => obj.StringValue ?? string.Empty)), "Test Table Migration to TestTableMigrationNullFromNull should retrieve similar values that created ones..."); + Assert.That(newObjs.Select(obj => obj.IntValue), Is.EqualTo(Enumerable.Repeat(0, 3)), "Test Table Migration to TestTableMigrationNullFromNull should retrieve all default int value to 0..."); } } } diff --git a/Tests/IntegrationTests/GameServer/InvalidNamesStartupTest.cs b/Tests/IntegrationTests/GameServer/InvalidNamesStartupTest.cs index b126682774..4cb14cd13c 100644 --- a/Tests/IntegrationTests/GameServer/InvalidNamesStartupTest.cs +++ b/Tests/IntegrationTests/GameServer/InvalidNamesStartupTest.cs @@ -35,25 +35,25 @@ public InvalidNamesStartupTest() [Test] public void InvalidNamesStartup_CheckDefaultConstraintOneString_Match() { - Assert.IsTrue(GameServer.Instance.PlayerManager.InvalidNames["fuck"]); + Assert.That(GameServer.Instance.PlayerManager.InvalidNames["fuck"], Is.True); } [Test] public void InvalidNamesStartup_CheckDefaultConstraintOneString_NoMatch() { - Assert.IsFalse(GameServer.Instance.PlayerManager.InvalidNames["unicorn"]); + Assert.That(GameServer.Instance.PlayerManager.InvalidNames["unicorn"], Is.False); } [Test] public void InvalidNamesStartup_CheckDefaultConstraintTwoString_Match() { - Assert.IsTrue(GameServer.Instance.PlayerManager.InvalidNames["fu", "ck"]); + Assert.That(GameServer.Instance.PlayerManager.InvalidNames["fu", "ck"], Is.True); } [Test] public void InvalidNamesStartup_CheckDefaultConstraintTwoString_NoMatch() { - Assert.IsFalse(GameServer.Instance.PlayerManager.InvalidNames["uni", "corn"]); + Assert.That(GameServer.Instance.PlayerManager.InvalidNames["uni", "corn"], Is.False); } } } diff --git a/Tests/IntegrationTests/GameServer/Test_Keeps.cs b/Tests/IntegrationTests/GameServer/Test_Keeps.cs index d39bd37cc5..abccc9fa00 100644 --- a/Tests/IntegrationTests/GameServer/Test_Keeps.cs +++ b/Tests/IntegrationTests/GameServer/Test_Keeps.cs @@ -60,7 +60,7 @@ public void ComponentFillPosition_TwoIdenticalComponentsWithAGuardEachOnSameKeep keepComponent2.Keep = keep; keepComponent2.LoadPositions(); keepComponent2.FillPositions(); - Assert.AreEqual(2, keepComponent.Keep.Guards.Count); + Assert.That(keepComponent.Keep.Guards.Count, Is.EqualTo(2)); } [Test] @@ -78,7 +78,7 @@ public void ComponentFillPosition_TwoIdenticalComponentsWithAGuardOnEachHeightOn keepComponent2.Keep = keep; keepComponent2.LoadPositions(); keepComponent2.FillPositions(); - Assert.AreEqual(4, keepComponent.Keep.Guards.Count); + Assert.That(keepComponent.Keep.Guards.Count, Is.EqualTo(4)); } private void AddKeepPositions() diff --git a/Tests/IntegrationTests/GameServer/Test_MerchantTradeItems.cs b/Tests/IntegrationTests/GameServer/Test_MerchantTradeItems.cs index 975ab3779c..996db0b503 100644 --- a/Tests/IntegrationTests/GameServer/Test_MerchantTradeItems.cs +++ b/Tests/IntegrationTests/GameServer/Test_MerchantTradeItems.cs @@ -64,7 +64,7 @@ public void GetAllItems_AddedMerchantItemWithCorrespondingItemtemplate_CountIsOn var actual = allItems.Count; var expected = 1; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -77,7 +77,7 @@ public void GetAllItems_AddedMerchantItemButItemTemplateIsMissing_CountIsZero() var actual = allItems.Count; var expected = 0; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -93,7 +93,7 @@ public void GetAllItems_AddTwoItems_CountIsOne() var actual = allItems.Count; var expected = 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -109,7 +109,7 @@ public void GetAllItems_AddTwoItemsButAtSameSlot_CountIsOne() var actual = allItems.Count; var expected = 1; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -125,7 +125,7 @@ public void GetAllItems_AddTwoItemsAtSameSlotButDifferentPage_CountIsTwo() var actual = allItems.Count; var expected = 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] diff --git a/Tests/IntegrationTests/GameServer/gameutils/InventoryTest.cs b/Tests/IntegrationTests/GameServer/gameutils/InventoryTest.cs index 6ede30932b..42b8c9c51e 100644 --- a/Tests/IntegrationTests/GameServer/gameutils/InventoryTest.cs +++ b/Tests/IntegrationTests/GameServer/gameutils/InventoryTest.cs @@ -37,13 +37,13 @@ public InventoryTest() {} public void InventoryTestCreation() { player = CreateMockGamePlayer(); - Assert.IsNotNull(player, "Player is null !"); + Assert.That(player, Is.Not.Null, "Player is null !"); itemt = DOLDB.SelectObject(DB.Column(nameof(ItemTemplate.Id_nb)).IsEqualTo("championDocharWardenBlade")); - Assert.IsNotNull(itemt, "ItemTemplate is null !"); + Assert.That(itemt, Is.Not.Null, "ItemTemplate is null !"); itemu = new ItemUnique(); itemu.Id_nb = "tunik"+DateTime.Now.Ticks; GameServer.Database.AddObject(itemu); - Assert.IsNotNull(itemu, "ItemUnique is created !"); + Assert.That(itemu, Is.Not.Null, "ItemUnique is created !"); _ = DOLDB.SelectObject(DB.Column(nameof(ItemTemplate.Id_nb)).IsEqualTo("traitors_dagger_hib")); } @@ -64,14 +64,14 @@ public void InventoryFromIT() InventoryItem ii = GameInventoryItem.Create(itemt); player.Inventory.AddItem(eInventorySlot.FirstBackpack, ii); - Assert.IsNotNull(ii, "ii-t #1 : " + ii.Template.Id_nb + " created & added to " + ii.OwnerID); + Assert.That(ii, Is.Not.Null, "ii-t #1 : " + ii.Template.Id_nb + " created & added to " + ii.OwnerID); var iicheck = GameServer.Database.FindObjectByKey(ii.ObjectId); - Assert.IsNotNull(iicheck, "ii-t #2 : saved in db " + ii.Template.Id_nb + " to " + ii.OwnerID); + Assert.That(iicheck, Is.Not.Null, "ii-t #2 : saved in db " + ii.Template.Id_nb + " to " + ii.OwnerID); GameServer.Database.DeleteObject(ii); iicheck = GameServer.Database.FindObjectByKey(ii.ObjectId); - Assert.IsNull(iicheck, "ii-t #3 : deleted from db " + ii.Template.Id_nb + " to " + ii.OwnerID); + Assert.That(iicheck, Is.Null, "ii-t #3 : deleted from db " + ii.Template.Id_nb + " to " + ii.OwnerID); var itcheck = GameServer.Database.FindObjectByKey(itemt.Id_nb); - Assert.IsNotNull(itcheck, "ii-t #4 : not deleted from db " + itemt.Id_nb); + Assert.That(itcheck, Is.Not.Null, "ii-t #4 : not deleted from db " + itemt.Id_nb); } [Test, Explicit] @@ -82,16 +82,16 @@ public void InventoryFromIU() InventoryItem ii = GameInventoryItem.Create(itemu); player.Inventory.AddItem(eInventorySlot.FirstBackpack, ii); - Assert.IsNotNull(ii, "ii-u #1 : " + ii.Template.Id_nb + " created & added to " + ii.OwnerID); + Assert.That(ii, Is.Not.Null, "ii-u #1 : " + ii.Template.Id_nb + " created & added to " + ii.OwnerID); var iicheck = GameServer.Database.FindObjectByKey(ii.ObjectId); - Assert.IsNotNull(iicheck, "ii-u #2 : saved in db " + ii.Template.Id_nb + " to " + ii.OwnerID); + Assert.That(iicheck, Is.Not.Null, "ii-u #2 : saved in db " + ii.Template.Id_nb + " to " + ii.OwnerID); var iucheck = GameServer.Database.FindObjectByKey(itemu.Id_nb); - Assert.IsNotNull(iicheck, "ii-u #3 : saved to db " + itemu.Id_nb); + Assert.That(iicheck, Is.Not.Null, "ii-u #3 : saved to db " + itemu.Id_nb); GameServer.Database.DeleteObject(ii); iicheck = GameServer.Database.FindObjectByKey(ii.ObjectId); - Assert.IsNull(iicheck, "ii-u #4 : deleted from db " + ii.Template.Id_nb + " to " + ii.OwnerID); + Assert.That(iicheck, Is.Null, "ii-u #4 : deleted from db " + ii.Template.Id_nb + " to " + ii.OwnerID); iucheck = GameServer.Database.FindObjectByKey(itemu.Id_nb); - Assert.IsNull(iucheck, "ii-t #5 : deleted from db " + itemu.Id_nb); + Assert.That(iucheck, Is.Null, "ii-t #5 : deleted from db " + itemu.Id_nb); } @@ -103,9 +103,9 @@ public void InventoryFromNull() InventoryItem ii = new InventoryItem(); player.Inventory.AddItem(eInventorySlot.FirstBackpack, ii); - Assert.IsNotNull(ii, "ii-g #1 : " + ii.Template.Id_nb + " created & added to " + ii.OwnerID); + Assert.That(ii, Is.Not.Null, "ii-g #1 : " + ii.Template.Id_nb + " created & added to " + ii.OwnerID); var iicheck = GameServer.Database.FindObjectByKey(ii.ObjectId); - Assert.IsNull(iicheck, "ii-g #2 : not saved in db " + ii.Template.Id_nb + " to " + ii.OwnerID); + Assert.That(iicheck, Is.Null, "ii-g #2 : not saved in db " + ii.Template.Id_nb + " to " + ii.OwnerID); } } } diff --git a/Tests/IntegrationTests/GameServer/gameutils/LanguageTest.cs b/Tests/IntegrationTests/GameServer/gameutils/LanguageTest.cs index 3385dcccee..d7e43fdc7a 100644 --- a/Tests/IntegrationTests/GameServer/gameutils/LanguageTest.cs +++ b/Tests/IntegrationTests/GameServer/gameutils/LanguageTest.cs @@ -34,7 +34,7 @@ public void TestGetString() { Console.WriteLine("TestGetString();"); Console.WriteLine(LanguageMgr.GetTranslation ("test","fail default string")); - Assert.IsTrue(true, "ok"); + Assert.That(true, Is.True, "ok"); } } } diff --git a/Tests/IntegrationTests/GameServer/gameutils/RegionTest.cs b/Tests/IntegrationTests/GameServer/gameutils/RegionTest.cs index 5dcfe46b02..4fc8addb6f 100644 --- a/Tests/IntegrationTests/GameServer/gameutils/RegionTest.cs +++ b/Tests/IntegrationTests/GameServer/gameutils/RegionTest.cs @@ -45,7 +45,7 @@ public void AddObject() if (obj.ObjectID<0) Assert.Fail("Failed to add object to Region. ObjectId < 0"); - Assert.AreEqual(obj.CurrentRegion.GetObject((ushort)obj.ObjectID),obj); + Assert.That(obj, Is.EqualTo(obj.CurrentRegion.GetObject((ushort)obj.ObjectID))); } @@ -56,10 +56,10 @@ public void AddArea() var circleLocation = Coordinate.Create(1000,1000,0); IArea insertArea = region.AddArea(new Area.Circle(null,circleLocation,500)); - Assert.IsNotNull(insertArea); + Assert.That(insertArea, Is.Not.Null); var areas = region.GetAreasOfSpot(Coordinate.Create(501,1000,0)); - Assert.IsTrue(areas.Count>0); + Assert.That(areas.Count>0, Is.True); bool found = false; foreach( IArea ar in areas) @@ -70,11 +70,11 @@ public void AddArea() break; } } - Assert.IsTrue(found); + Assert.That(found, Is.True); // areas = region.GetAreasOfSpot(Coordinate.Create(1499,1000,2000)); - Assert.IsTrue(areas.Count>0); + Assert.That(areas.Count>0, Is.True); found = false; foreach( IArea ar in areas) @@ -85,7 +85,7 @@ public void AddArea() break; } } - Assert.IsTrue(found); + Assert.That(found, Is.True); //Notify test @@ -96,12 +96,12 @@ public void AddArea() insertArea.RegisterPlayerEnter(new DOLEventHandler(NotifyTest)); insertArea.OnPlayerEnter(player); - Assert.IsTrue(notified); + Assert.That(notified, Is.True); region.RemoveArea(insertArea); areas = region.GetAreasOfSpot(Coordinate.Create(1499,1000,2000)); - Assert.IsTrue(areas.Count==0); + Assert.That(areas.Count==0, Is.True); } diff --git a/Tests/IntegrationTests/GameServer/gameutils/ServerTest.cs b/Tests/IntegrationTests/GameServer/gameutils/ServerTest.cs index 42a7c9bd78..9d9431d1e4 100644 --- a/Tests/IntegrationTests/GameServer/gameutils/ServerTest.cs +++ b/Tests/IntegrationTests/GameServer/gameutils/ServerTest.cs @@ -34,7 +34,7 @@ public ServerTest() public void TestGameServerStartup() { Console.WriteLine("Test GameServer Startup..."); - Assert.IsTrue(GameServer.Instance.IsRunning && GameServer.Instance.ServerStatus == eGameServerStatus.GSS_Open, "GameServer is not running correctly : " + GameServer.Instance.ServerStatus); + Assert.That(GameServer.Instance.IsRunning && GameServer.Instance.ServerStatus == eGameServerStatus.GSS_Open, Is.True, "GameServer is not running correctly : " + GameServer.Instance.ServerStatus); } } } diff --git a/Tests/IntegrationTests/GameServer/gameutils/Train1105.cs b/Tests/IntegrationTests/GameServer/gameutils/Train1105.cs index 29d2accc25..7d43ae0e13 100644 --- a/Tests/IntegrationTests/GameServer/gameutils/Train1105.cs +++ b/Tests/IntegrationTests/GameServer/gameutils/Train1105.cs @@ -31,7 +31,7 @@ public class Train1105 : ServerTests public void TrainNow() { GamePlayer player = CreateMockGamePlayer(); - Assert.IsNotNull(player); + Assert.That(player, Is.Not.Null); player.Out.SendTrainerWindow(); return; } diff --git a/Tests/IntegrationTests/GameServer/gameutils/ZoneTest.cs b/Tests/IntegrationTests/GameServer/gameutils/ZoneTest.cs index 2eddf263ff..453a43ade6 100644 --- a/Tests/IntegrationTests/GameServer/gameutils/ZoneTest.cs +++ b/Tests/IntegrationTests/GameServer/gameutils/ZoneTest.cs @@ -43,7 +43,7 @@ public void GetZCoordinateTest() public void GetRandomNPCTest() { Zone zone = WorldMgr.GetZone(0); - Assert.IsNotNull(zone); + Assert.That(zone, Is.Not.Null); StartWatch(); GameNPC npc = zone.GetRandomNPC(eRealm.None, 5, 7); diff --git a/Tests/IntegrationTests/GameServer/quests/KillTaskTest.cs b/Tests/IntegrationTests/GameServer/quests/KillTaskTest.cs index b38cee98fc..40a6b7cf4f 100644 --- a/Tests/IntegrationTests/GameServer/quests/KillTaskTest.cs +++ b/Tests/IntegrationTests/GameServer/quests/KillTaskTest.cs @@ -56,8 +56,8 @@ public void CreateKillTask() { KillTask task =(KillTask) player.Task; - Assert.IsNotNull(task); - Assert.IsTrue(task.TaskActive); + Assert.That(task, Is.Not.Null); + Assert.That(task.TaskActive, Is.True); Console.WriteLine("Mob:"+ task.MobName); Console.WriteLine("Item:"+ task.ItemName); diff --git a/Tests/IntegrationTests/GameServer/quests/MoneyTaskTest.cs b/Tests/IntegrationTests/GameServer/quests/MoneyTaskTest.cs index c022b9e7d2..e20f94f06b 100644 --- a/Tests/IntegrationTests/GameServer/quests/MoneyTaskTest.cs +++ b/Tests/IntegrationTests/GameServer/quests/MoneyTaskTest.cs @@ -52,7 +52,7 @@ public void CreateMoneyTask() MoneyTask task = (MoneyTask)player.Task; - Assert.IsNotNull(task); + Assert.That(task, Is.Not.Null); Console.WriteLine("XP" + task.RewardXP); Console.WriteLine("Item:" + task.ItemName); Console.WriteLine("Item:" + task.Name); diff --git a/Tests/IntegrationTests/GameServer/quests/Test_DataQuest.cs b/Tests/IntegrationTests/GameServer/quests/Test_DataQuest.cs index f81d5a3671..8c25b04d95 100644 --- a/Tests/IntegrationTests/GameServer/quests/Test_DataQuest.cs +++ b/Tests/IntegrationTests/GameServer/quests/Test_DataQuest.cs @@ -51,18 +51,18 @@ public void ParseQuest_GivenDBDataQuest_SetData() { var dataQuest = new DataQuestSpy(dbDataQuest); - Assert.AreEqual(23886, dataQuest.ID); - Assert.AreEqual("QuestName", dataQuest.Name); - Assert.AreEqual(DataQuest.eStartType.Standard, dataQuest.StartType); - Assert.AreEqual("description", dataQuest.Description); - Assert.AreEqual(null, dataQuest.SpySourceName); - Assert.AreEqual(1, dataQuest.MaxQuestCount); - Assert.AreEqual(1, dataQuest.Level); - Assert.AreEqual(11, dataQuest.MaxLevel); - Assert.AreEqual("", dataQuest.OptionalRewards); - Assert.AreEqual("", dataQuest.FinalRewards); - Assert.AreEqual(new List() { "Basics of Combat (Hibernia)" }, dataQuest.SpyQuestDependency); - Assert.AreEqual(new List { 1, 2, 3 }, dataQuest.SpyAllowedClasses); + Assert.That(dataQuest.ID, Is.EqualTo(23886)); + Assert.That(dataQuest.Name, Is.EqualTo("QuestName")); + Assert.That(dataQuest.StartType, Is.EqualTo(DataQuest.eStartType.Standard)); + Assert.That(dataQuest.Description, Is.EqualTo("description")); + Assert.That(dataQuest.SpySourceName, Is.EqualTo(null)); + Assert.That(dataQuest.MaxQuestCount, Is.EqualTo(1)); + Assert.That(dataQuest.Level, Is.EqualTo(1)); + Assert.That(dataQuest.MaxLevel, Is.EqualTo(11)); + Assert.That(dataQuest.OptionalRewards, Is.EqualTo("")); + Assert.That(dataQuest.FinalRewards, Is.EqualTo("")); + Assert.That(dataQuest.SpyQuestDependency, Is.EqualTo(new List() { "Basics of Combat (Hibernia)" })); + Assert.That(dataQuest.SpyAllowedClasses, Is.EqualTo(new List { 1, 2, 3 })); } [Test] @@ -76,17 +76,17 @@ public void ParseQuest_GivenDBDataQuest_CompareStepData() { dataQuest.Step = i; int index = i - 1; - Assert.AreEqual(new List() { 0, 4, 6, 6, 5 }[index], (byte)dataQuest.StepType, "Failed at Step " + dataQuest.Step); - Assert.AreEqual(new List() { 1, 2, 3, 4, 5 }[index], dataQuest.SpyRewardMoney); - Assert.AreEqual(new long[] { 6, 7, 8, 9, 10 }[index], dataQuest.SpyRewardXP); - Assert.AreEqual(0, dataQuest.SpyRewardBP); - Assert.AreEqual(new string[] { "tic", "trick", "truck", "track", "trock" }[index], dataQuest.TargetName); - Assert.AreEqual(new long[] { 10, 9, 8, 7, 6 }[index], dataQuest.TargetRegion); - Assert.AreEqual(new string[] { "foo", "bar", "baz", "bork", "fuu" }[index], dataQuest.SpyTargetText); - Assert.AreEqual("storyA", dataQuest.Story); - Assert.AreEqual(new string[] { "storyA", "", "storyC", "storyD", "storyEnd" }[index], dataQuest.SpySourceText); - Assert.AreEqual(new string[] { "step1", "step2", "step3", "step4", "step5"}[index], dataQuest.StepTexts[index]); - Assert.AreEqual(new string[] { "item1", "item2", "item3", "item4", "item5" }[index], dataQuest.SpyStepItemTemplate); + Assert.That((byte)dataQuest.StepType, Is.EqualTo(new List() { 0, 4, 6, 6, 5 }[index]), "Failed at Step " + dataQuest.Step); + Assert.That(dataQuest.SpyRewardMoney, Is.EqualTo(new List() { 1, 2, 3, 4, 5 }[index])); + Assert.That(dataQuest.SpyRewardXP, Is.EqualTo(new long[] { 6, 7, 8, 9, 10 }[index])); + Assert.That(dataQuest.SpyRewardBP, Is.EqualTo(0)); + Assert.That(dataQuest.TargetName, Is.EqualTo(new string[] { "tic", "trick", "truck", "track", "trock" }[index])); + Assert.That(dataQuest.TargetRegion, Is.EqualTo(new long[] { 10, 9, 8, 7, 6 }[index])); + Assert.That(dataQuest.SpyTargetText, Is.EqualTo(new string[] { "foo", "bar", "baz", "bork", "fuu" }[index])); + Assert.That(dataQuest.Story, Is.EqualTo("storyA")); + Assert.That(dataQuest.SpySourceText, Is.EqualTo(new string[] { "storyA", "", "storyC", "storyD", "storyEnd" }[index])); + Assert.That(dataQuest.StepTexts[index], Is.EqualTo(new string[] { "step1", "step2", "step3", "step4", "step5"}[index])); + Assert.That(dataQuest.SpyStepItemTemplate, Is.EqualTo(new string[] { "item1", "item2", "item3", "item4", "item5" }[index])); } } diff --git a/Tests/IntegrationTests/GameServer/world/RegionOidAllocation.cs b/Tests/IntegrationTests/GameServer/world/RegionOidAllocation.cs index 2d57acefa8..01b8d3a3b4 100644 --- a/Tests/IntegrationTests/GameServer/world/RegionOidAllocation.cs +++ b/Tests/IntegrationTests/GameServer/world/RegionOidAllocation.cs @@ -60,8 +60,8 @@ public void AddRemoveObjects() for (int i = 0; i < count; i++) { GameNPC mob = mobs[i] = new GameNPC(); - Assert.IsTrue(mob.ObjectID == -1, "mob {0} oid={1}, should be -1", i, mob.ObjectID); - Assert.IsFalse(mob.ObjectState == GameObject.eObjectState.Active, "mob {0} state={1}, should be not Active", i, mob.ObjectState); + Assert.That(mob.ObjectID == -1, Is.True, $"mob {i} oid={mob.ObjectID}, should be -1"); + Assert.That(mob.ObjectState == GameObject.eObjectState.Active, Is.False, $"mob {i} state={mob.ObjectState}, should be not Active"); mob.Name = "test mob " + i; mob.CurrentRegion = m_reg; m_reg.PreAllocateRegionSpace(1953); @@ -75,8 +75,8 @@ public void AddRemoveObjects() { // Console.Out.WriteLine("add "+i); GameNPC mob = mobs[i]; - Assert.IsTrue(mob.AddToWorld(), "failed to add {0} to the world", mob.Name); - Assert.IsTrue(mob.ObjectID > 0 && mob.ObjectID <= DOL.GS.ServerProperties.Properties.REGION_MAX_OBJECTS, "{0} oid={1}", mob.Name, mob.ObjectID); + Assert.That(mob.AddToWorld(), Is.True, "failed to add {0} to the world", mob.Name); + Assert.That(mob.ObjectID > 0 && mob.ObjectID <= DOL.GS.ServerProperties.Properties.REGION_MAX_OBJECTS, Is.True, $"{mob.Name} oid={mob.ObjectID}"); } for (int i = count-x; i >= 0; i--) @@ -84,7 +84,7 @@ public void AddRemoveObjects() // Console.Out.WriteLine("check "+i); GameNPC mob = mobs[i]; GameNPC regMob = (GameNPC)m_reg.GetObject((ushort)mob.ObjectID); - Assert.AreSame(mob, regMob, "expected to read '{0}' oid={1} but read '{2}' oid={3}", mob.Name, mob.ObjectID, regMob==null?"null":regMob.Name, regMob==null?"null":regMob.ObjectID.ToString()); + Assert.That(regMob, Is.SameAs(mob), $"expected to read '{mob.Name}' oid={mob.ObjectID} but read '{(regMob==null?"null":regMob.Name)}' oid={(regMob==null?"null":regMob.ObjectID)}"); } Console.Out.WriteLine("[{0}] loop {1} remove mobs", id, count-x); @@ -94,11 +94,11 @@ public void AddRemoveObjects() // Console.Out.WriteLine("remove "+i); GameNPC mob = mobs[i]; int oid = mob.ObjectID; - Assert.IsTrue(mob.RemoveFromWorld(), "failed to remove {0}", mob.Name); - Assert.IsTrue(mob.ObjectID == -1, "{0}: oid is not -1 (oid={1})", mob.Name, mob.ObjectID); - Assert.IsFalse(mob.ObjectState == GameObject.eObjectState.Active, "{0} is still active after remove", mob.Name); + Assert.That(mob.RemoveFromWorld(), Is.True, "failed to remove {0}", mob.Name); + Assert.That(mob.ObjectID == -1, Is.True, $"{mob.Name}: oid is not -1 (oid={mob.ObjectID})"); + Assert.That(mob.ObjectState == GameObject.eObjectState.Active, Is.False, "{0} is still active after remove", mob.Name); GameNPC regMob = (GameNPC)m_reg.GetObject((ushort)oid); - Assert.IsNull(regMob, "{0} was removed from the region but oid {1} is still used by {2}", mob.Name, oid, regMob==null?"null":regMob.Name); + Assert.That(regMob, Is.Null, $"{mob.Name} was removed from the region but oid {oid} is still used by {(regMob==null?"null":regMob.Name)}"); } } } diff --git a/Tests/IntegrationTests/Managers/FriendsManagerTest.cs b/Tests/IntegrationTests/Managers/FriendsManagerTest.cs index 480abcd6f2..430958ec93 100644 --- a/Tests/IntegrationTests/Managers/FriendsManagerTest.cs +++ b/Tests/IntegrationTests/Managers/FriendsManagerTest.cs @@ -41,13 +41,13 @@ public FriendsManagerTest() [Test] public void FriendsManager_StartUp_NotNull() { - Assert.IsNotNull(GameServer.Instance.PlayerManager.Friends); + Assert.That(GameServer.Instance.PlayerManager.Friends, Is.Not.Null); } [Test] public void FriendsManager_NoAdd_RetrieveEmptyGamePlayerList() { - CollectionAssert.IsEmpty(GameServer.Instance.PlayerManager.Friends[null]); + Assert.That(GameServer.Instance.PlayerManager.Friends[null], Is.Empty); } [Test] @@ -61,7 +61,7 @@ public void FriendsManager_AddPlayer_RetrieveFriendsList() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); - CollectionAssert.IsEmpty(gameplayer.GetFriends()); + Assert.That(gameplayer.GetFriends(), Is.Empty); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -77,7 +77,7 @@ public void FriendsManager_RemovePlayer_RetrieveEmptyFriendsList() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); - CollectionAssert.IsEmpty(gameplayer.GetFriends()); + Assert.That(gameplayer.GetFriends(), Is.Empty); } [Test] @@ -91,8 +91,8 @@ public void FriendsManager_AddPlayerWithFriend_RetrieveFriendsList() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { client.Account.Characters[0].SerializedFriendsList }); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { "buddy" }); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { client.Account.Characters[0].SerializedFriendsList })); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { "buddy" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -107,8 +107,8 @@ public void FriendsManager_AddPlayerWithFriends_RetrieveFriendsList() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), gameplayer.SerializedFriendsList); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { "buddy", "mate", "someone" }); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(gameplayer.SerializedFriendsList)); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { "buddy", "mate", "someone" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -124,8 +124,8 @@ public void FriendsManager_AddFriend_RetrieveFriend() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); gameplayer.AddFriend("buddy"); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { client.Account.Characters[0].SerializedFriendsList }); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { "buddy" }); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { client.Account.Characters[0].SerializedFriendsList })); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { "buddy" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -143,8 +143,8 @@ public void FriendsManager_AddFriends_RetrieveFriend() gameplayer.AddFriend("mate"); gameplayer.AddFriend("someone"); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), gameplayer.SerializedFriendsList); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { "buddy", "mate", "someone" }); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(gameplayer.SerializedFriendsList)); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { "buddy", "mate", "someone" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -159,11 +159,11 @@ public void FriendsManager_AddDuplicate_RetrieveOnlyOne() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); gameplayer.AddFriend("buddy"); - Assert.IsFalse(gameplayer.AddFriend("buddy")); + Assert.That(gameplayer.AddFriend("buddy"), Is.False); gameplayer.AddFriend("someone"); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), gameplayer.SerializedFriendsList); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { "buddy", "someone" }); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(gameplayer.SerializedFriendsList)); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { "buddy", "someone" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -178,9 +178,9 @@ public void FriendsManager_RemoveFriend_RetrieveEmpty() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); gameplayer.AddFriend("buddy"); - CollectionAssert.IsNotEmpty(gameplayer.GetFriends()); + Assert.That(gameplayer.GetFriends(), Is.Not.Empty); gameplayer.RemoveFriend("buddy"); - CollectionAssert.IsEmpty(gameplayer.GetFriends()); + Assert.That(gameplayer.GetFriends(), Is.Empty); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -197,11 +197,11 @@ public void FriendsManager_RemoveFriends_RetrieveEmpty() gameplayer.AddFriend("buddy"); gameplayer.AddFriend("mate"); gameplayer.AddFriend("someone"); - CollectionAssert.IsNotEmpty(gameplayer.GetFriends()); + Assert.That(gameplayer.GetFriends(), Is.Not.Empty); gameplayer.RemoveFriend("buddy"); gameplayer.RemoveFriend("mate"); gameplayer.RemoveFriend("someone"); - CollectionAssert.IsEmpty(gameplayer.GetFriends()); + Assert.That(gameplayer.GetFriends(), Is.Empty); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -216,9 +216,9 @@ public void FriendsManager_RemoveNonExisting_RetrieveOne() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayer); gameplayer.AddFriend("buddy"); - CollectionAssert.IsNotEmpty(gameplayer.GetFriends()); - Assert.IsFalse(gameplayer.RemoveFriend("mate")); - CollectionAssert.AreEquivalent(gameplayer.GetFriends(), new [] { "buddy" }); + Assert.That(gameplayer.GetFriends(), Is.Not.Empty); + Assert.That(gameplayer.RemoveFriend("mate"), Is.False); + Assert.That(gameplayer.GetFriends(), Is.EquivalentTo(new [] { "buddy" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -235,7 +235,7 @@ public void FriendsManager_NotifyPlayerWorldEnter_ReceivePacketEmptyList() client.ClientState = GameClient.eClientState.WorldEnter; - CollectionAssert.IsEmpty(received); + Assert.That(received, Is.Empty); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); } @@ -260,7 +260,7 @@ public void FriendsManager_NotifyPlayerWorldEnterWithFriends_ReceivePacketMateLi client.ClientState = GameClient.eClientState.WorldEnter; - CollectionAssert.AreEquivalent(new[] { "mate" }, received); + Assert.That(received, Is.EquivalentTo(new[] { "mate" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } @@ -294,7 +294,7 @@ public void FriendsManager_NotifyPlayerWorldEnterWithFriendsAnon_ReceivePacketMa client.ClientState = GameClient.eClientState.WorldEnter; - CollectionAssert.AreEquivalent(new[] { "mate" }, received); + Assert.That(received, Is.EquivalentTo(new[] { "mate" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerBuddy); @@ -322,7 +322,7 @@ public void FriendsManager_FriendsGetAnonymous_ReceiveRemovePacket() gameplayerMate.IsAnonymous = true; - CollectionAssert.AreEquivalent(new[] { "mate" }, received); + Assert.That(received, Is.EquivalentTo(new[] { "mate" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } @@ -349,7 +349,7 @@ public void FriendsManager_FriendsUnsetAnonymous_ReceiveAddPacket() gameplayerMate.IsAnonymous = false; - CollectionAssert.AreEquivalent(new[] { "mate" }, received); + Assert.That(received, Is.EquivalentTo(new[] { "mate" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } @@ -375,7 +375,7 @@ public void FriendsManager_FriendsEnterGame_ReceiveAddPacket() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayerMate); GameEventMgr.Notify(GamePlayerEvent.GameEntered, gameplayerMate); - CollectionAssert.AreEquivalent(new[] { "mate" }, received); + Assert.That(received, Is.EquivalentTo(new[] { "mate" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } @@ -401,7 +401,7 @@ public void FriendsManager_FriendsEnterGameAnon_ReceiveNoAddPacket() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayerMate); GameEventMgr.Notify(GamePlayerEvent.GameEntered, gameplayerMate); - Assert.IsNull(received); + Assert.That(received, Is.Null); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } @@ -427,7 +427,7 @@ public void FriendsManager_FriendsExitGame_ReceiveRemovePacket() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayerMate); GameEventMgr.Notify(GamePlayerEvent.Quit, gameplayerMate); - CollectionAssert.AreEquivalent(new[] { "mate" }, received); + Assert.That(received, Is.EquivalentTo(new[] { "mate" })); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } @@ -453,7 +453,7 @@ public void FriendsManager_FriendsExitGame_ReceiveNoRemovePacket() GameServer.Instance.PlayerManager.Friends.AddPlayerFriendsListToCache(gameplayerMate); GameEventMgr.Notify(GamePlayerEvent.Quit, gameplayerMate); - Assert.IsNull(received); + Assert.That(received, Is.Null); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayer); GameServer.Instance.PlayerManager.Friends.RemovePlayerFriendsListFromCache(gameplayerMate); } diff --git a/Tests/IntegrationTests/Managers/InvalidNamesManagerTest.cs b/Tests/IntegrationTests/Managers/InvalidNamesManagerTest.cs index 8b1262dcda..be0ab9d9ca 100644 --- a/Tests/IntegrationTests/Managers/InvalidNamesManagerTest.cs +++ b/Tests/IntegrationTests/Managers/InvalidNamesManagerTest.cs @@ -38,9 +38,9 @@ public void InvalidNamesManager_LoadContainsAndCheckOneString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "Bob" } ); - Assert.IsTrue(manager["bob"], "'bob' should match 'Bob' Pattern with case insensitive..."); - Assert.IsTrue(manager["boba fett"], "'boba fett' should match 'Bob' Pattern with case insensitive..."); - Assert.IsTrue(manager["FOOBobBAR"], "'FOOBobBAR' should match 'Bob' Pattern with case insensitive..."); + Assert.That(manager["bob"], Is.True, "'bob' should match 'Bob' Pattern with case insensitive..."); + Assert.That(manager["boba fett"], Is.True, "'boba fett' should match 'Bob' Pattern with case insensitive..."); + Assert.That(manager["FOOBobBAR"], Is.True, "'FOOBobBAR' should match 'Bob' Pattern with case insensitive..."); } [Test] @@ -49,9 +49,9 @@ public void InvalidNamesManager_LoadContainsAndCheckOneString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "Bob" } ); - Assert.IsFalse(manager["john"], "'john' should not match 'Bob' Pattern..."); - Assert.IsFalse(manager["han solo"], "'han solo' not should match 'Bob' Pattern..."); - Assert.IsFalse(manager["FOOBAR"], "'FOOBAR' should not match 'Bob' Pattern..."); + Assert.That(manager["john"], Is.False, "'john' should not match 'Bob' Pattern..."); + Assert.That(manager["han solo"], Is.False, "'han solo' not should match 'Bob' Pattern..."); + Assert.That(manager["FOOBAR"], Is.False, "'FOOBAR' should not match 'Bob' Pattern..."); } [Test] @@ -60,9 +60,9 @@ public void InvalidNamesManager_LoadContainsAndCheckTwoString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "Bob" } ); - Assert.IsTrue(manager["bo", "b"], "'bo' 'b' should match 'Bob' Pattern with case insensitive..."); - Assert.IsTrue(manager["boba", "fett"], "'boba' 'fett' should match 'Bob' Pattern with case insensitive..."); - Assert.IsTrue(manager["FOOB", "obBAR"], "'FOOB' 'obBAR' should match 'Bob' Pattern with case insensitive..."); + Assert.That(manager["bo", "b"], Is.True, "'bo' 'b' should match 'Bob' Pattern with case insensitive..."); + Assert.That(manager["boba", "fett"], Is.True, "'boba' 'fett' should match 'Bob' Pattern with case insensitive..."); + Assert.That(manager["FOOB", "obBAR"], Is.True, "'FOOB' 'obBAR' should match 'Bob' Pattern with case insensitive..."); } [Test] @@ -71,9 +71,9 @@ public void InvalidNamesManager_LoadContainsAndCheckTwoString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "Bob" } ); - Assert.IsFalse(manager["jo", "hn"], "'jo' 'hn' should not match 'Bob' Pattern..."); - Assert.IsFalse(manager["han", "solo"], "'han' 'solo' not should match 'Bob' Pattern..."); - Assert.IsFalse(manager["FO", "OBAR"], "'FO' 'OBAR' should not match 'Bob' Pattern..."); + Assert.That(manager["jo", "hn"], Is.False, "'jo' 'hn' should not match 'Bob' Pattern..."); + Assert.That(manager["han", "solo"], Is.False, "'han' 'solo' not should match 'Bob' Pattern..."); + Assert.That(manager["FO", "OBAR"], Is.False, "'FO' 'OBAR' should not match 'Bob' Pattern..."); } [Test] @@ -82,10 +82,10 @@ public void InvalidNamesManager_LoadRegexAndCheckOneString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/" } ); - Assert.IsTrue(manager["bob"], "'bob' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["boba fett"], "'boba fett' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["FOOBobBAR"], "'FOOBobBAR' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["F O O B o b B A R"], "'F O O B o b B A R' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["bob"], Is.True, "'bob' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["boba fett"], Is.True, "'boba fett' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["FOOBobBAR"], Is.True, "'FOOBobBAR' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["F O O B o b B A R"], Is.True, "'F O O B o b B A R' should match '/B.*o.*b/' Pattern with case insensitive..."); } [Test] @@ -94,10 +94,10 @@ public void InvalidNamesManager_LoadRegexAndCheckOneString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/" } ); - Assert.IsFalse(manager["john"], "'john' should not match '/B.*o.*b/' Pattern..."); - Assert.IsFalse(manager["han solo"], "'han solo' not should match '/B.*o.*b/' Pattern..."); - Assert.IsFalse(manager["FOOBAR"], "'FOOBAR' should not match '/B.*o.*b/' Pattern..."); - Assert.IsFalse(manager["F O O B A R"], "'F O O B A R' should not match '/B.*o.*b/' Pattern..."); + Assert.That(manager["john"], Is.False, "'john' should not match '/B.*o.*b/' Pattern..."); + Assert.That(manager["han solo"], Is.False, "'han solo' not should match '/B.*o.*b/' Pattern..."); + Assert.That(manager["FOOBAR"], Is.False, "'FOOBAR' should not match '/B.*o.*b/' Pattern..."); + Assert.That(manager["F O O B A R"], Is.False, "'F O O B A R' should not match '/B.*o.*b/' Pattern..."); } [Test] @@ -106,10 +106,10 @@ public void InvalidNamesManager_LoadRegexAndCheckTwoString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/" } ); - Assert.IsTrue(manager["bo", "b"], "'bo' 'b' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["boba", "fett"], "'boba' 'fett' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["FOOB", "obBAR"], "'FOOB' 'obBAR' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["F O O", " B o b B A R"], "'F O O' ' B o b B A R' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["bo", "b"], Is.True, "'bo' 'b' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["boba", "fett"], Is.True, "'boba' 'fett' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["FOOB", "obBAR"], Is.True, "'FOOB' 'obBAR' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["F O O", " B o b B A R"], Is.True, "'F O O' ' B o b B A R' should match '/B.*o.*b/' Pattern with case insensitive..."); } [Test] @@ -118,10 +118,10 @@ public void InvalidNamesManager_LoadRegexAndCheckTwoString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/" } ); - Assert.IsFalse(manager["jo", "hn"], "'jo' 'hn' should not match '/B.*o.*b/' Pattern..."); - Assert.IsFalse(manager["han", "solo"], "'han' 'solo' not should match '/B.*o.*b/' Pattern..."); - Assert.IsFalse(manager["FOOB", "AR"], "'FOOB' 'AR' should not match '/B.*o.*b/' Pattern..."); - Assert.IsFalse(manager["F O O", " B A R"], "'F O O' ' B A R' should not match '/B.*o.*b/' Pattern..."); + Assert.That(manager["jo", "hn"], Is.False, "'jo' 'hn' should not match '/B.*o.*b/' Pattern..."); + Assert.That(manager["han", "solo"], Is.False, "'han' 'solo' not should match '/B.*o.*b/' Pattern..."); + Assert.That(manager["FOOB", "AR"], Is.False, "'FOOB' 'AR' should not match '/B.*o.*b/' Pattern..."); + Assert.That(manager["F O O", " B A R"], Is.False, "'F O O' ' B A R' should not match '/B.*o.*b/' Pattern..."); } [Test] @@ -130,10 +130,10 @@ public void InvalidNamesManager_LoadMultiConstraintsCheckOneString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/", "/B.*a.*r/", "FOO", "Luke" } ); - Assert.IsTrue(manager["bar"], "'bar' should match '/B.*a.*r/' Pattern with case insensitive..."); - Assert.IsTrue(manager["boba fett"], "'boba fett' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["FOOBobBAR"], "'FOOBobBAR' should match 'FOO' Pattern with case insensitive..."); - Assert.IsTrue(manager["LukeSkywalker"], "'LukeSkywalker' should match 'Luke' Pattern with case insensitive..."); + Assert.That(manager["bar"], Is.True, "'bar' should match '/B.*a.*r/' Pattern with case insensitive..."); + Assert.That(manager["boba fett"], Is.True, "'boba fett' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["FOOBobBAR"], Is.True, "'FOOBobBAR' should match 'FOO' Pattern with case insensitive..."); + Assert.That(manager["LukeSkywalker"], Is.True, "'LukeSkywalker' should match 'Luke' Pattern with case insensitive..."); } [Test] @@ -142,10 +142,10 @@ public void InvalidNamesManager_LoadMultiConstraintsCheckOneString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/", "/B.*a.*r/", "FOO", "Luke" } ); - Assert.IsFalse(manager["john"], "'john' should not match any Pattern..."); - Assert.IsFalse(manager["han solo"], "'han solo' should not match any Pattern..."); - Assert.IsFalse(manager["FARBABBoo"], "'FARBABBoo' should not match any Pattern..."); - Assert.IsFalse(manager["AnakinSkywalker"], "'AnakinSkywalker' should not match any Pattern..."); + Assert.That(manager["john"], Is.False, "'john' should not match any Pattern..."); + Assert.That(manager["han solo"], Is.False, "'han solo' should not match any Pattern..."); + Assert.That(manager["FARBABBoo"], Is.False, "'FARBABBoo' should not match any Pattern..."); + Assert.That(manager["AnakinSkywalker"], Is.False, "'AnakinSkywalker' should not match any Pattern..."); } [Test] @@ -154,10 +154,10 @@ public void InvalidNamesManager_LoadMultiConstraintsCheckTwoString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/", "/B.*a.*r/", "FOO", "Luke" } ); - Assert.IsTrue(manager["ba", "r"], "'ba' 'r' should match '/B.*a.*r/' Pattern with case insensitive..."); - Assert.IsTrue(manager["boba", "fett"], "'boba' 'fett' should match '/B.*o.*b/' Pattern with case insensitive..."); - Assert.IsTrue(manager["FOOB", "obBAR"], "'FOOB' 'obBAR' should match 'FOO' Pattern with case insensitive..."); - Assert.IsTrue(manager["LukeSky", " walker"], "'LukeSky' ' walker' should match 'Luke' Pattern with case insensitive..."); + Assert.That(manager["ba", "r"], Is.True, "'ba' 'r' should match '/B.*a.*r/' Pattern with case insensitive..."); + Assert.That(manager["boba", "fett"], Is.True, "'boba' 'fett' should match '/B.*o.*b/' Pattern with case insensitive..."); + Assert.That(manager["FOOB", "obBAR"], Is.True, "'FOOB' 'obBAR' should match 'FOO' Pattern with case insensitive..."); + Assert.That(manager["LukeSky", " walker"], Is.True, "'LukeSky' ' walker' should match 'Luke' Pattern with case insensitive..."); } [Test] @@ -166,10 +166,10 @@ public void InvalidNamesManager_LoadMultiConstraintsCheckTwoString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "/B.*o.*b/", "/B.*a.*r/", "FOO", "Luke" } ); - Assert.IsFalse(manager["jo", "hn"], "'jo' 'hn' should not match any Pattern..."); - Assert.IsFalse(manager["han", "solo"], "'han' 'solo' should not match any Pattern..."); - Assert.IsFalse(manager["FARB", "ABBoo"], "'FARB' 'ABBoo' should not match any Pattern..."); - Assert.IsFalse(manager["AnakinSky", " walker"], "'AnakinSky' ' walker' should not match any Pattern..."); + Assert.That(manager["jo", "hn"], Is.False, "'jo' 'hn' should not match any Pattern..."); + Assert.That(manager["han", "solo"], Is.False, "'han' 'solo' should not match any Pattern..."); + Assert.That(manager["FARB", "ABBoo"], Is.False, "'FARB' 'ABBoo' should not match any Pattern..."); + Assert.That(manager["AnakinSky", " walker"], Is.False, "'AnakinSky' ' walker' should not match any Pattern..."); } [Test] @@ -178,9 +178,9 @@ public void InvalidNamesManager_LoadCommentCheckOneString_NoMatch() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "BA #R", "#Luke", "bob" } ); - Assert.IsFalse(manager["Luke"], "'Luke' should not match any Pattern..."); - Assert.IsFalse(manager["B AR"], "'B AR' should not match any Pattern..."); - Assert.IsFalse(manager["han solo"], "'han solo' should not match any Pattern..."); + Assert.That(manager["Luke"], Is.False, "'Luke' should not match any Pattern..."); + Assert.That(manager["B AR"], Is.False, "'B AR' should not match any Pattern..."); + Assert.That(manager["han solo"], Is.False, "'han solo' should not match any Pattern..."); } [Test] @@ -189,9 +189,9 @@ public void InvalidNamesManager_LoadCommentCheckOneString_Match() var manager = new InvalidNamesManager(string.Empty); manager.LoadFromLines(new [] { "BA #R", "#Luke", "bob" } ); - Assert.IsTrue(manager["Bob"], "'Bob' should match 'Bob' Pattern..."); - Assert.IsTrue(manager["BA F"], "'BA F' should match 'BA' Pattern..."); - Assert.IsTrue(manager["bobaFett"], "'boba' should match 'BA' Pattern..."); + Assert.That(manager["Bob"], Is.True, "'Bob' should match 'Bob' Pattern..."); + Assert.That(manager["BA F"], Is.True, "'BA F' should match 'BA' Pattern..."); + Assert.That(manager["bobaFett"], Is.True, "'boba' should match 'BA' Pattern..."); } } } diff --git a/Tests/IntegrationTests/Managers/WeatherManagerTest.cs b/Tests/IntegrationTests/Managers/WeatherManagerTest.cs index 075d34ca6b..2b51ca23be 100644 --- a/Tests/IntegrationTests/Managers/WeatherManagerTest.cs +++ b/Tests/IntegrationTests/Managers/WeatherManagerTest.cs @@ -62,7 +62,7 @@ public void WeatherManager_GetNonExistentRegion_ReturnNull() { var weatherMgr = new WeatherManager(new SimpleScheduler()); - Assert.IsNull(weatherMgr[1]); + Assert.That(weatherMgr[1], Is.Null); } [Test] @@ -70,7 +70,7 @@ public void WeatherManager_ChangeWeatherNonExistentRegion_ReturnFalse() { var weatherMgr = new WeatherManager(new SimpleScheduler()); - Assert.IsFalse(weatherMgr.ChangeWeather(1, weather => weather.Clear())); + Assert.That(weatherMgr.ChangeWeather(1, weather => weather.Clear()), Is.False); } [Test] @@ -81,7 +81,7 @@ public void WeatherManager_RegisterRegion_ReturnRegion() var region = FakeRegion(); weatherMgr.RegisterRegion(region); - Assert.AreEqual(weatherMgr[1].Region, region); + Assert.That(region, Is.EqualTo(weatherMgr[1].Region)); } [Test] @@ -93,7 +93,7 @@ public void WeatherManager_UnRegisterRegion_ReturnNull() weatherMgr.RegisterRegion(region); weatherMgr.UnRegisterRegion(region); - Assert.IsNull(weatherMgr[1]); + Assert.That(weatherMgr[1], Is.Null); } [Test] @@ -104,7 +104,7 @@ public void WeatherManager_StartWeatherRegion_ReturnTrue() var region = FakeRegion(); weatherMgr.RegisterRegion(region); - Assert.IsTrue(weatherMgr.StartWeather(1)); + Assert.That(weatherMgr.StartWeather(1), Is.True); } [Test] @@ -116,7 +116,7 @@ public void WeatherManager_StopWeatherRegion_ReturnTrue() weatherMgr.RegisterRegion(region); weatherMgr.StartWeather(1); - Assert.IsTrue(weatherMgr.StopWeather(1)); + Assert.That(weatherMgr.StopWeather(1), Is.True); } [Test] @@ -128,7 +128,7 @@ public void WeatherManager_StartWeatherRegion_StartTime() weatherMgr.RegisterRegion(region); weatherMgr.StartWeather(1); - Assert.Greater(weatherMgr[1].StartTime, 0); + Assert.That(weatherMgr[1].StartTime, Is.GreaterThan(0)); } [Test] @@ -141,7 +141,7 @@ public void WeatherManager_StopWeatherRegion_StartTime() weatherMgr.StartWeather(1); weatherMgr.StopWeather(1); - Assert.AreEqual(0, weatherMgr[1].StartTime); + Assert.That(weatherMgr[1].StartTime, Is.EqualTo(0)); } [Test] @@ -154,8 +154,8 @@ public void WeatherManager_ChangeWeatherRegion_WeatherEqual() weatherMgr.ChangeWeather(1, weather => weather.CreateWeather(65000, 300, 100, 16000, 0)); - Assert.AreEqual((65535 + 65000) / 300, weatherMgr[1].Duration / 1000); - Assert.AreEqual(65000, weatherMgr[1].Width); + Assert.That(weatherMgr[1].Duration / 1000, Is.EqualTo((65535 + 65000) / 300)); + Assert.That(weatherMgr[1].Width, Is.EqualTo(65000)); } [Test] @@ -168,8 +168,8 @@ public void WeatherManager_ChangeWeatherRegionException_WeatherEqual() weatherMgr.ChangeWeather(1, weather => { weather.CreateWeather(65000, 300, 100, 16000, 0); throw new Exception(); }); - Assert.AreEqual((65535 + 65000) / 300, weatherMgr[1].Duration / 1000); - Assert.AreEqual(65000, weatherMgr[1].Width); + Assert.That(weatherMgr[1].Duration / 1000, Is.EqualTo((65535 + 65000) / 300)); + Assert.That(weatherMgr[1].Width, Is.EqualTo(65000)); } [Test] @@ -181,8 +181,8 @@ public void WeatherRegion_InitWeather_MinMaxEqualZone() var duration = (65535 + 65000) * 1000 / 300; - Assert.AreEqual(65535 + 65000, weather.CurrentPosition(duration)); - Assert.AreEqual(0, weather.CurrentPosition(0)); + Assert.That(weather.CurrentPosition(duration), Is.EqualTo(65535 + 65000)); + Assert.That(weather.CurrentPosition(0), Is.EqualTo(0)); } } diff --git a/Tests/IntegrationTests/SchedulerTest.cs b/Tests/IntegrationTests/SchedulerTest.cs index 7be1a3c74e..6cce959c01 100644 --- a/Tests/IntegrationTests/SchedulerTest.cs +++ b/Tests/IntegrationTests/SchedulerTest.cs @@ -56,7 +56,7 @@ public void Scheduler_AddTimer_RetrieveTask() var task = scheduler.Start(() => 0, 10); - Assert.IsTrue(task.Active, "Task should be active after Scheduler Insertion..."); + Assert.That(task.Active, Is.True, "Task should be active after Scheduler Insertion..."); } [Test] @@ -68,7 +68,7 @@ public void Scheduler_StopTimer_TaskInactive() task.Stop(); - Assert.IsFalse(task.Active, "Task should be inactive after Scheduler Stop..."); + Assert.That(task.Active, Is.False, "Task should be inactive after Scheduler Stop..."); } [Test] @@ -85,7 +85,7 @@ public void Scheduler_StopTimerLatency_TaskNotRun() System.Threading.Thread.Sleep(100); - Assert.IsFalse(run, "Task should not have run when Stopping before delay..."); + Assert.That(run, Is.False, "Task should not have run when Stopping before delay..."); } [Test] @@ -100,7 +100,7 @@ public void Scheduler_StopTimerLatency_TaskRun() task.Stop(); - Assert.IsTrue(run, "Task should have run when Stopping after delay..."); + Assert.That(run, Is.True, "Task should have run when Stopping after delay..."); } [Test] @@ -114,12 +114,12 @@ public void Scheduler_StartIntervalTimer_TaskRunMultipleTime() System.Threading.Thread.Sleep(100); var intermediate = count; - Assert.Greater(intermediate, 0, "Task Should have been Scheduled multiple time with an Interval of 1ms..."); + Assert.That(intermediate, Is.GreaterThan(0), "Task Should have been Scheduled multiple time with an Interval of 1ms..."); System.Threading.Thread.Sleep(100); task.Stop(); - Assert.Greater(count, intermediate, "Task should have been scheduled again before stopping..."); + Assert.That(count, Is.GreaterThan(intermediate), "Task should have been scheduled again before stopping..."); } [Test] @@ -132,9 +132,9 @@ public void Scheduler_StartTimerOnce_TaskRunOnce() System.Threading.Thread.Sleep(100); - Assert.AreEqual(count, 1, "Task Should have been Scheduled once with no Interval..."); + Assert.That(1, Is.EqualTo(count), "Task Should have been Scheduled once with no Interval..."); - Assert.IsFalse(task.Active, "Task Should be inactive after one Scheduling..."); + Assert.That(task.Active, Is.False, "Task Should be inactive after one Scheduling..."); } [Test] @@ -147,8 +147,8 @@ public void Scheduler_IntervalTimerFixedCount_CountRun() System.Threading.Thread.Sleep(200); - Assert.AreEqual(10, count, "Task Should have been Scheduled 10 times..."); - Assert.IsFalse(task.Active, "Task should be Inactive after Fixed Schedule count..."); + Assert.That(count, Is.EqualTo(10), "Task Should have been Scheduled 10 times..."); + Assert.That(task.Active, Is.False, "Task should be Inactive after Fixed Schedule count..."); } [Test] @@ -162,8 +162,8 @@ public void Scheduler_TimerStartLatency_LowerThan() System.Threading.Thread.Sleep(100); - Assert.Less(finished - start, 100, "Scheduler Task Latency is higher than 100ms!"); - Assert.IsFalse(task.Active, "Task Should be inactive after Scheduling..."); + Assert.That(finished - start, Is.LessThan(100), "Scheduler Task Latency is higher than 100ms!"); + Assert.That(task.Active, Is.False, "Task Should be inactive after Scheduling..."); } [Test, Explicit] @@ -181,11 +181,11 @@ public void Scheduler_MultiInsertStopTest_AllTasksFinished() System.Threading.Thread.Sleep(100); - CollectionAssert.AreEqual(Enumerable.Range(0, 10).Select(i => false), shortTasks.Select(t => t.Active)); + Assert.That(shortTasks.Select(t => t.Active), Is.EqualTo(Enumerable.Range(0, 10).Select(i => false))); System.Threading.Thread.Sleep(900); - CollectionAssert.AreEqual(Enumerable.Range(0, 10).Select(i => false), longTasks.Select(t => t.Active)); + Assert.That(longTasks.Select(t => t.Active), Is.EqualTo(Enumerable.Range(0, 10).Select(i => false))); } [Test, Explicit] @@ -205,13 +205,13 @@ public void Scheduler_MultiInsertInterval_FixedCountRun() System.Threading.Thread.Sleep(1100); - CollectionAssert.AreEqual(Enumerable.Range(0, 10).Select(i => 10), shortCount); - CollectionAssert.AreEqual(Enumerable.Range(0, 10).Select(i => false), shortTasks.Select(t => t.Active)); + Assert.That(shortCount, Is.EqualTo(Enumerable.Range(0, 10).Select(i => 10))); + Assert.That(shortTasks.Select(t => t.Active), Is.EqualTo(Enumerable.Range(0, 10).Select(i => false))); System.Threading.Thread.Sleep(1900); - CollectionAssert.AreEqual(Enumerable.Range(0, 10).Select(i => 5), longCount); - CollectionAssert.AreEqual(Enumerable.Range(0, 10).Select(i => false), longTasks.Select(t => t.Active)); + Assert.That(longCount, Is.EqualTo(Enumerable.Range(0, 10).Select(i => 5))); + Assert.That(longTasks.Select(t => t.Active), Is.EqualTo(Enumerable.Range(0, 10).Select(i => false))); } [Test, Explicit] @@ -223,7 +223,7 @@ public void Scheduler_TimerLongRuntime_LogDisplay() System.Threading.Thread.Sleep(1000); - Assert.IsFalse(task.Active, "Task should have been scheduled to Test Exception..."); + Assert.That(task.Active, Is.False, "Task should have been scheduled to Test Exception..."); } [Test] @@ -235,7 +235,7 @@ public void Scheduler_TimerException_LogDisplay() System.Threading.Thread.Sleep(100); - Assert.IsFalse(task.Active, "Task should have been scheduled to Test Exception..."); + Assert.That(task.Active, Is.False, "Task should have been scheduled to Test Exception..."); } } } diff --git a/Tests/IntegrationTests/Server.cs b/Tests/IntegrationTests/Server.cs index 0f05837fd2..f65b7bc7f2 100644 --- a/Tests/IntegrationTests/Server.cs +++ b/Tests/IntegrationTests/Server.cs @@ -37,14 +37,14 @@ protected GamePlayer CreateMockGamePlayer() { DOLCharacters character= null; var account = GameServer.Database.SelectAllObjects().FirstOrDefault(); - Assert.IsNotNull(account); + Assert.That(account, Is.Not.Null); foreach (var charact in account.Characters) { if (charact!=null) character = charact; } - Assert.IsNotNull(character); + Assert.That(character, Is.Not.Null); var client = new GameClient(GameServer.Instance); client.Version = GameClient.eClientVersion.Version1105; @@ -53,7 +53,7 @@ protected GamePlayer CreateMockGamePlayer() client.PacketProcessor = new PacketProcessor(client); client.Out = new PacketLib1105(client); client.Player = new GamePlayer(client,character); - Assert.IsNotNull(client.Player,"GamePlayer instance created"); + Assert.That(client.Player, Is.Not.Null,"GamePlayer instance created"); return client.Player; } diff --git a/Tests/IntegrationTests/UPnP.cs b/Tests/IntegrationTests/UPnP.cs index 834cd5ea95..9d64899aad 100644 --- a/Tests/IntegrationTests/UPnP.cs +++ b/Tests/IntegrationTests/UPnP.cs @@ -36,7 +36,7 @@ public void init() [Test, Explicit] public void Discover() { - Assert.IsTrue(upnp.Discover()); + Assert.That(upnp.Discover(), Is.True); } } } diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index fa72637366..cb18a78ee4 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -4,7 +4,7 @@ - net6.0 + net8.0 Debug AnyCPU Tests @@ -39,8 +39,8 @@ False - - + + diff --git a/Tests/UnitTests/GameObject/UT_GameNPC.cs b/Tests/UnitTests/GameObject/UT_GameNPC.cs index df645b4462..ec80925881 100644 --- a/Tests/UnitTests/GameObject/UT_GameNPC.cs +++ b/Tests/UnitTests/GameObject/UT_GameNPC.cs @@ -21,7 +21,7 @@ public void GetModified_Constitution_GameNPCWith75Constitution_75Percent() int actual = npc.GetModified(eProperty.Constitution); - Assert.AreEqual(75, actual); + Assert.That(actual, Is.EqualTo(75)); } [Test] @@ -31,7 +31,7 @@ public void GetArmorAbsorb_LevelZeroNPCHasOneConstitution_Circa5Percent() var actual = npc.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(-0.05, actual, 0.001); + Assert.That(actual, Is.EqualTo(-0.05).Within(0.001)); } [Test] @@ -43,7 +43,7 @@ public void GetArmorAbsorb_LevelZeroNPCwith60BaseAnd120BaseBuffConstitution_30Pe var actual = npc.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(0.30, actual, 0.001); + Assert.That(actual, Is.EqualTo(0.30).Within(0.001)); } [Test] @@ -55,7 +55,7 @@ public void GetArmorAbsorb_L30NPCWith60Constitution_27Percent() var actual = npc.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(0.27, actual, 0.001); + Assert.That(actual, Is.EqualTo(0.27).Within(0.001)); } [Test] @@ -67,7 +67,7 @@ public void GetArmorAbsorb_LevelZeroNPCWith50ConDebuff_Minus25Percent() var actual = npc.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(-0.25, actual, 0.001); + Assert.That(actual, Is.EqualTo(-0.25).Within(0.001)); } private static GameNPC NewNPC() => new GameNPC(new FakeControlledBrain()); @@ -91,7 +91,7 @@ public void GetArmorAbsorb_AnySlot_L30Guard_27Percent() var actual = guard.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(0.27, actual, 0.001); + Assert.That(actual, Is.EqualTo(0.27).Within(0.001)); } [Test] @@ -103,7 +103,7 @@ public void GetArmorAbsorb_AnySlot_L30GuardLord_32Percent() var actual = guard.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(0.32, actual, 0.001); + Assert.That(actual, Is.EqualTo(0.32).Within(0.001)); } [Test] @@ -115,7 +115,7 @@ public void GetArmorAbsorb_AnySlot_L30GuardCaster_22Percent() var actual = guard.GetArmorAbsorb(eArmorSlot.NOTSET); - Assert.AreEqual(0.22, actual, 0.001); + Assert.That(actual, Is.EqualTo(0.22).Within(0.001)); } } } diff --git a/Tests/UnitTests/GameObject/UT_GamePlayer.cs b/Tests/UnitTests/GameObject/UT_GamePlayer.cs index 4ad59c8a45..e4f56964b3 100644 --- a/Tests/UnitTests/GameObject/UT_GamePlayer.cs +++ b/Tests/UnitTests/GameObject/UT_GamePlayer.cs @@ -23,7 +23,7 @@ public void Constitution_Level50PlayerWith100ConstBaseBuff_Return62() int actual = player.Constitution; int expected = (int)(50 * 1.25); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -36,7 +36,7 @@ public void Constitution_Level50PlayerWith100ConstSpecBuff_Return93() int actual = player.Constitution; int expected = (int)(50 * 1.875); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -49,7 +49,7 @@ public void Constitution_Level50Player100ConstFromItems_Return75() int actual = player.Constitution; int expected = (int)(1.5 * 50); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -61,7 +61,7 @@ public void Intelligence_Level50IntCasterWith50AcuityFromItems_Return50() int actual = player.Intelligence; - Assert.AreEqual(50, actual); + Assert.That(actual, Is.EqualTo(50)); } [Test] @@ -74,7 +74,7 @@ public void Constitution_Level50Player150ConAnd100MythicalConCap_Return127() int actual = player.Constitution; - Assert.AreEqual(127, actual); + Assert.That(actual, Is.EqualTo(127)); } [Test] @@ -88,7 +88,7 @@ public void Constitution_Level50PlayerWith5MythicalConCap100ConCap_Return106() int actual = player.Constitution; - Assert.AreEqual(106, actual); + Assert.That(actual, Is.EqualTo(106)); } [Test] @@ -100,7 +100,7 @@ public void CalcValue_GetIntelligenceFromLevel50IntCasterWith50Acuity_Return50() int actual = player.Intelligence; - Assert.AreEqual(50, actual); + Assert.That(actual, Is.EqualTo(50)); } [Test] @@ -114,7 +114,7 @@ public void Intelligence_Level50IntCasterWith200AcuityAnd30AcuCapEachFromItems_R int actual = player.Intelligence; - Assert.AreEqual(127, actual); + Assert.That(actual, Is.EqualTo(127)); } [Test] @@ -127,7 +127,7 @@ public void Intelligence_Level50IntCasterWith30AcuityAnd30IntelligenceFromItems_ int actual = player.Intelligence; - Assert.AreEqual(60, actual); + Assert.That(actual, Is.EqualTo(60)); } [Test] @@ -141,7 +141,7 @@ public void Constitution_Level30With200ConAnd20ConCapEachViaItems_Return81() int actual = player.Constitution; - Assert.AreEqual(81, actual); + Assert.That(actual, Is.EqualTo(81)); } private static GamePlayer CreatePlayer() diff --git a/Tests/UnitTests/Geometry/UT_Angle.cs b/Tests/UnitTests/Geometry/UT_Angle.cs index 3158147ae8..46e27ed75e 100644 --- a/Tests/UnitTests/Geometry/UT_Angle.cs +++ b/Tests/UnitTests/Geometry/UT_Angle.cs @@ -13,7 +13,7 @@ public void Equals_TwoNewAnglesWithZeroDegrees_True() var angleA = Angle.Degrees(0); var angleB = Angle.Degrees(0); - Assert.IsTrue(angleA.Equals(angleB)); + Assert.That(angleA.Equals(angleB), Is.True); } [Test] @@ -22,7 +22,7 @@ public void Equals_TwoDifferentAngles_False() var angleA = Angle.Degrees(0); var angleB = Angle.Degrees(1); - Assert.IsFalse(angleA.Equals(angleB)); + Assert.That(angleA.Equals(angleB), Is.False); } [Test] @@ -31,7 +31,7 @@ public void Equals_MinusOneDegreesAnd359Degrees_True() var angleA = Angle.Degrees(-1); var angleB = Angle.Degrees(359); - Assert.IsTrue(angleA.Equals(angleB)); + Assert.That(angleA.Equals(angleB), Is.True); } [Test] @@ -41,7 +41,7 @@ public void Heading_One_InHeadingIsOne() var expected = 1; var actual = angle.InHeading; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -51,7 +51,7 @@ public void Degrees_One_InDegreesIsOne() var expected = 1; var actual = angle.InHeading; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -60,7 +60,7 @@ public void PlusOperator_OneHeadingWithOneHeading_TwoHeading() var actual = Angle.Heading(1) + Angle.Heading(1); var expected = Angle.Heading(2); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -69,7 +69,7 @@ public void MinusOperator_OneHeadingMinusOneHeading_AngleZero() var actual = Angle.Heading(1) - Angle.Heading(1); var expected = Angle.Zero; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -78,7 +78,7 @@ public void Radians_One2048thPi_OneHeading() var actual = Angle.Radians(Math.PI/2048); var expected = Angle.Heading(1); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -87,6 +87,6 @@ public void Radians_One180thPi_OneDegree() var actual = Angle.Radians(Math.PI/180); var expected = Angle.Degrees(1); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } \ No newline at end of file diff --git a/Tests/UnitTests/Geometry/UT_Motion.cs b/Tests/UnitTests/Geometry/UT_Motion.cs index 615638b041..24530ce795 100644 --- a/Tests/UnitTests/Geometry/UT_Motion.cs +++ b/Tests/UnitTests/Geometry/UT_Motion.cs @@ -14,7 +14,7 @@ public void GetLocationAfter_Zero_Start() var actual = Motion.Create(start, destination: Coordinate.Nowhere, withSpeed: 0) .GetPositonAfter(0); - Assert.AreEqual(start, actual); + Assert.That(actual, Is.EqualTo(start)); } [Test] @@ -26,7 +26,7 @@ public void GetLocationAfter_FromZeroAfter1000MilliSecondsWithSpeed100AndOrienta var actual = motion.GetPositonAfter(1000); var expected = start + Vector.Create(y: 100); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -39,6 +39,6 @@ public void GetLocationAfter_FromZeroAfter1000MilliSecondsWithSpeed100AndOrienta var actual = motion.GetPositonAfter(1000); var expected = destination; - Assert.AreEqual(destination, actual); + Assert.That(actual, Is.EqualTo(destination)); } } \ No newline at end of file diff --git a/Tests/UnitTests/Geometry/UT_Vector.cs b/Tests/UnitTests/Geometry/UT_Vector.cs index 5789a72324..b38af7b169 100644 --- a/Tests/UnitTests/Geometry/UT_Vector.cs +++ b/Tests/UnitTests/Geometry/UT_Vector.cs @@ -13,7 +13,7 @@ public void Equals_TwoNewVectors_True() var vectorA = Vector.Create(); var vectorB = Vector.Create(); - Assert.IsTrue(vectorA.Equals(vectorB)); + Assert.That(vectorA.Equals(vectorB), Is.True); } [Test] @@ -22,7 +22,7 @@ public void Equals_VectorWithDifferentX_False() var vectorA = Vector.Create(x: 0); var vectorB = Vector.Create(x: 1); - Assert.IsFalse(vectorA.Equals(vectorB)); + Assert.That(vectorA.Equals(vectorB), Is.False); } [Test] @@ -33,7 +33,7 @@ public void PlusOperator_TwoVectorsWithLengthOne_VectorWithLength2() var actual = (vector + vector).Length; var expectedLength = 2; - Assert.AreEqual(expectedLength, actual); + Assert.That(actual, Is.EqualTo(expectedLength)); } [Test] @@ -42,7 +42,7 @@ public void Create_OrientationZeroWithLengthOne_SameAsVectorWithYOne() var actual = Vector.Create(orientation: Angle.Zero, length: 1); var expected = Vector.Create(y: 1); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -51,7 +51,7 @@ public void Create_Orientation45DegreesWithLengthOneHundred_VectorWithXMinus71An var actual = Vector.Create(orientation: Angle.Degrees(45), length: 100); var expected = Vector.Create(x: -71, y: 71); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -62,7 +62,7 @@ public void RotatedClockwise_VectorXOneHundredBy90Degrees_VectorWithYOneHundred( var actual = vector.RotatedClockwise(Angle.Degrees(90)); var expected = Vector.Create(y: 100); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -74,7 +74,7 @@ public void RotatedClockwise_VectorXOneHundredBy45Degrees_VectorWithX71AndY71() //rounded var expected = Vector.Create(x: 71, y: 71); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -86,7 +86,7 @@ public void RotatedClockwise_VectorX50By45Degrees_VectorWithX35AndY35() //rounded var expected = Vector.Create(x: 35, y: 35); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } @@ -99,7 +99,7 @@ public void Length_VectorX1Y2Z2_3() var actual = vector.Length; var expected = 3d; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -110,6 +110,6 @@ public void Length2D_VectorX3Y4Z100_5() var actual = vector.Length2D; var expected = 5d; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } \ No newline at end of file diff --git a/Tests/UnitTests/PropertyCalculator/UT_MeleeDamagePercentCalculator.cs b/Tests/UnitTests/PropertyCalculator/UT_MeleeDamagePercentCalculator.cs index 6194663a04..e71ae18d67 100644 --- a/Tests/UnitTests/PropertyCalculator/UT_MeleeDamagePercentCalculator.cs +++ b/Tests/UnitTests/PropertyCalculator/UT_MeleeDamagePercentCalculator.cs @@ -15,7 +15,7 @@ public void CalcValue_50StrengthBuff_6() int actual = MeleeDamageBonusCalculator.CalcValue(npc, MeleeDamageProperty); - Assert.AreEqual(6, actual); + Assert.That(actual, Is.EqualTo(6)); } [Test] @@ -26,7 +26,7 @@ public void CalcValue_NPCWith50StrengthDebuff_Minus6() int actual = MeleeDamageBonusCalculator.CalcValue(npc, MeleeDamageProperty); - Assert.AreEqual(-6, actual); + Assert.That(actual, Is.EqualTo(-6)); } private MeleeDamagePercentCalculator MeleeDamageBonusCalculator => new MeleeDamagePercentCalculator(); diff --git a/Tests/UnitTests/PropertyCalculator/UT_ResistCalculator.cs b/Tests/UnitTests/PropertyCalculator/UT_ResistCalculator.cs index 4f022a7ce2..902658ac78 100644 --- a/Tests/UnitTests/PropertyCalculator/UT_ResistCalculator.cs +++ b/Tests/UnitTests/PropertyCalculator/UT_ResistCalculator.cs @@ -15,7 +15,7 @@ public void CalcValue_50ConBuff_6() int actual = ResistCalculator.CalcValue(npc, SomeResistProperty); - Assert.AreEqual(6, actual); + Assert.That(actual, Is.EqualTo(6)); } [Test] @@ -26,7 +26,7 @@ public void CalcValue_50ConDebuff_Minus6() int actual = ResistCalculator.CalcValue(npc, SomeResistProperty); - Assert.AreEqual(-6, actual); + Assert.That(actual, Is.EqualTo(-6)); } private ResistCalculator ResistCalculator => new ResistCalculator(); diff --git a/Tests/UnitTests/PropertyCalculator/UT_StatCalculator.cs b/Tests/UnitTests/PropertyCalculator/UT_StatCalculator.cs index 0fa034f455..9b641ed9fd 100644 --- a/Tests/UnitTests/PropertyCalculator/UT_StatCalculator.cs +++ b/Tests/UnitTests/PropertyCalculator/UT_StatCalculator.cs @@ -16,7 +16,7 @@ public void CalcValueFromBuffs_GameNPCWith100ConstBaseBuff_100() int actual = StatCalculator.CalcValueFromBuffs(npc, eProperty.Constitution); - Assert.AreEqual(100, actual); + Assert.That(actual, Is.EqualTo(100)); } [Test] @@ -29,7 +29,7 @@ public void CalcValueFromBuffs_Level50PlayerWith100ConstBaseBuff_62() int actual = StatCalculator.CalcValueFromBuffs(player, eProperty.Constitution); int expected = (int)(50 * 1.25); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -42,7 +42,7 @@ public void CalcValueFromBuffs_Level50PlayerWith100ConstSpecBuff_93() int actual = StatCalculator.CalcValueFromBuffs(player, eProperty.Constitution); int expected = (int)(50 * 1.875); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -55,7 +55,7 @@ public void CalcValueFromBuffs_BaseBuff3AndSpecBuff4_7() int actual = StatCalculator.CalcValueFromBuffs(npc, eProperty.Constitution); int expected = 7; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +63,7 @@ public void CalcValueFromBuffs_LivingIsNull_Zero() { int actual = StatCalculator.CalcValueFromBuffs(null, eProperty.Constitution); - Assert.AreEqual(0, actual); + Assert.That(actual, Is.EqualTo(0)); } [Test] @@ -71,7 +71,7 @@ public void CalcValueFromItems_LivingIsNull_Zero() { int actual = StatCalculator.CalcValueFromItems(null, eProperty.Constitution); - Assert.AreEqual(0, actual); + Assert.That(actual, Is.EqualTo(0)); } [Test] @@ -84,7 +84,7 @@ public void CalcValueFromItems_Level50Player100ConstFromItems_75() int actual = StatCalculator.CalcValueFromItems(player, eProperty.Constitution); int expected = (int)(1.5 * 50); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -98,7 +98,7 @@ public void CalcValueFromItems_Level50NPC100ConstFromItems_75() int actual = StatCalculator.CalcValueFromItems(npc, stat); int expected = (int)(1.5 * 50); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -111,7 +111,7 @@ public void CalcValueFromItems_IntelligenceOfLevel50IntCasterWith50AcuityFromIte int actual = StatCalculator.CalcValueFromItems(player, eProperty.Intelligence); - Assert.AreEqual(50, actual); + Assert.That(actual, Is.EqualTo(50)); } [Test] @@ -124,7 +124,7 @@ public void CalcValueFromItems_Level50Player150ConAnd100MythicalConCap_127() int actual = StatCalculator.CalcValueFromItems(player, eProperty.Constitution); - Assert.AreEqual(127, actual); + Assert.That(actual, Is.EqualTo(127)); } [Test] @@ -138,7 +138,7 @@ public void CalcValueFromItems_Level50PlayerWith5MythicalConCap100ConCap_106() int actual = StatCalculator.CalcValueFromItems(player, eProperty.Constitution); - Assert.AreEqual(106, actual); + Assert.That(actual, Is.EqualTo(106)); } [Test] @@ -151,7 +151,7 @@ public void GetItemBonusCapIncrease_Level50Player100ConstCap_26() int actual = StatCalculator.GetItemBonusCapIncrease(player, eProperty.Constitution); int expected = (int)(50 / 2.0 + 1); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -163,7 +163,7 @@ public void GetItemBonusCapIncrease_Level50Player10ConstCap_10() int actual = StatCalculator.GetItemBonusCapIncrease(player, eProperty.Constitution); - Assert.AreEqual(10, actual); + Assert.That(actual, Is.EqualTo(10)); } [Test] @@ -174,7 +174,7 @@ public void GetMythicalItemBonusCapIncrease_PlayerWith100MythicalConCap_52() int actual = StatCalculator.GetMythicalItemBonusCapIncrease(player, eProperty.Constitution); - Assert.AreEqual(52, actual); + Assert.That(actual, Is.EqualTo(52)); } [Test] @@ -185,7 +185,7 @@ public void GetMythicalItemBonusCapIncrease_PlayerWith10MythicalConCap_10() int actual = StatCalculator.GetMythicalItemBonusCapIncrease(player, eProperty.Constitution); - Assert.AreEqual(10, actual); + Assert.That(actual, Is.EqualTo(10)); } [Test] @@ -196,7 +196,7 @@ public void CalcValue_NPCWith100Constitution_100() int actual = StatCalculator.CalcValue(npc, eProperty.Constitution); - Assert.AreEqual(100, actual); + Assert.That(actual, Is.EqualTo(100)); } [Test] @@ -207,7 +207,7 @@ public void CalcValue_NPCWith100Intelligence_100() int actual = StatCalculator.CalcValue(npc, eProperty.Intelligence); - Assert.AreEqual(100, actual); + Assert.That(actual, Is.EqualTo(100)); } [Test] @@ -220,7 +220,7 @@ public void CalcValue_GetIntelligenceFromLevel50IntCasterWith50Acuity_50() int actual = StatCalculator.CalcValue(player, eProperty.Intelligence); - Assert.AreEqual(50, actual); + Assert.That(actual, Is.EqualTo(50)); } [Test] @@ -231,7 +231,7 @@ public void CalcValue_200ConstitutionAbilityBonus_200() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); - Assert.AreEqual(200, actual); + Assert.That(actual, Is.EqualTo(200)); } [Test] @@ -242,7 +242,7 @@ public void CalcValue_200ConstitutionDebuff_1() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); - Assert.AreEqual(1, actual); + Assert.That(actual, Is.EqualTo(1)); } [Test] @@ -254,7 +254,7 @@ public void CalcValue_200ConAbilityBonusAnd50ConDebuff_200() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); - Assert.AreEqual(200 - (50/2), actual); + Assert.That(actual, Is.EqualTo(200 - (50/2))); } [Test] @@ -267,7 +267,7 @@ public void CalcValue_70ConBuffBonusAnd50ConDebuff_20() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); - Assert.AreEqual(20, actual); + Assert.That(actual, Is.EqualTo(20)); } [Test] @@ -281,7 +281,7 @@ public void CalcValue_70ConItemBonusAnd50ConDebuff_45() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); int expected = 70 - (50 / 2); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -295,7 +295,7 @@ public void CalcValue_70ConBaseStatAnd50ConDebuff_45() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); int expected = 70 - (50 / 2); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -308,7 +308,7 @@ public void CalcValue_70ConBaseStatAnd3ConLostOnDeath_67() int actual = StatCalculator.CalcValue(player, eProperty.Constitution); - Assert.AreEqual(67, actual); + Assert.That(actual, Is.EqualTo(67)); } public static StatCalculator StatCalculator => new StatCalculator(); diff --git a/Tests/UnitTests/UT_ControlledNpcBrain.cs b/Tests/UnitTests/UT_ControlledNpcBrain.cs index 0415b67c73..54264096e2 100644 --- a/Tests/UnitTests/UT_ControlledNpcBrain.cs +++ b/Tests/UnitTests/UT_ControlledNpcBrain.cs @@ -33,7 +33,7 @@ public void GetPlayerOwner_InitWithPlayer_Player() var actual = brain.GetPlayerOwner(); var expected = player; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } } diff --git a/Tests/UnitTests/UT_Currency.cs b/Tests/UnitTests/UT_Currency.cs index 6e78f54356..2c029b6b44 100644 --- a/Tests/UnitTests/UT_Currency.cs +++ b/Tests/UnitTests/UT_Currency.cs @@ -15,7 +15,7 @@ public void Equals_SameCurrencyAndSameValue_True() var actual = money1.Equals(money2); - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -26,7 +26,7 @@ public void Equals_SameCurrencyAndDifferentValue_False() var actual = money1.Equals(money2); - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -37,7 +37,7 @@ public void Equals_SameValueButDifferentCurrencyType_False() var actual = money1.Equals(money2); - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -50,7 +50,7 @@ public void Equals_ItemCurrenciesWithDifferentId_False() var actual = money1.Equals(money2); - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -63,7 +63,7 @@ public void Equals_ItemCurrenciesWithSameId_True() var actual = money1.Equals(money2); - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } } } \ No newline at end of file diff --git a/Tests/UnitTests/UT_DataQuest.cs b/Tests/UnitTests/UT_DataQuest.cs index 0d6021edff..b35ced930a 100644 --- a/Tests/UnitTests/UT_DataQuest.cs +++ b/Tests/UnitTests/UT_DataQuest.cs @@ -25,7 +25,7 @@ public void MoneyReward_Init_Zero() var actual = dataQuest.MoneyReward(); var expected = 0; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -37,7 +37,7 @@ public void ExperiencePercent_Init_Zero() var actual = dataQuest.ExperiencePercent(player); var expected = 0; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -49,7 +49,7 @@ public void MoneyReward_RewardMoneyIs2InAString_2() var actual = dataQuest.MoneyReward(); var expected = 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -63,7 +63,7 @@ public void ExperiencePercent_PlayerIsLevelOneAndRewardXPIs2InAString_4() var actual = dataQuest.ExperiencePercent(player); var expected = 4; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -77,7 +77,7 @@ public void RewardMoney_SetTo2Pipe3Pipe4OnStep2_3() var actual = dataQuest.SpyRewardMoney; var expected = 3; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -91,7 +91,7 @@ public void RewardXP_SetTo2Pipe3Pipe4OnStepOne_3() var actual = dataQuest.SpyRewardXP; var expected = 3; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -105,7 +105,7 @@ public void RewardCLXP_SetTo4_4() var actual = dataQuest.SpyRewardCLXP; var expected = 4; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -119,7 +119,7 @@ public void RewardRP_SetTo5_5() var actual = dataQuest.SpyRewardRP; var expected = 5; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -133,7 +133,7 @@ public void RewardBP_SetTo6_6() var actual = dataQuest.SpyRewardBP; var expected = 6; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -145,7 +145,7 @@ public void StepType_Init_StepTypeUnknown() var actual = dataQuest.StepType; var expected = DataQuest.eStepType.Unknown; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -155,7 +155,7 @@ public void Step_Init_Zero() var actual = dataQuest.Step; var expected = 0; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } #endregion Accessor @@ -168,7 +168,7 @@ public void CheckQuestQualification_Default_True() bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsTrue(isQualified); + Assert.That(isQualified, Is.True); } [Test] @@ -181,7 +181,7 @@ public void CheckQuestQualification_PlayerIsLevelOneAndMinLevelIsTwo_False() bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsFalse(isQualified); + Assert.That(isQualified, Is.False); } [Test] @@ -196,7 +196,7 @@ public void CheckQuestQualification_PlayerIsPaladinAndAllowedClassIsCleric_False bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsFalse(isQualified); + Assert.That(isQualified, Is.False); } [Test] @@ -213,7 +213,7 @@ public void CheckQuestQualification_PlayerDidQuestThreeTimesAndMaxCountIsThree_F bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsFalse(isQualified); + Assert.That(isQualified, Is.False); } [Test] @@ -225,7 +225,7 @@ public void CheckQuestQualification_PlayerStartedQuestAlready_False() player.fakeQuestList.Add(dataQuest); bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsFalse(isQualified); + Assert.That(isQualified, Is.False); } [Test] @@ -239,7 +239,7 @@ public void CheckQuestQualification_PlayerFinishedQuestAlreadyAndMaxCountReached player.fakeQuestListFinished.Add(dataQuest); bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsFalse(isQualified); + Assert.That(isQualified, Is.False); } [Test] @@ -252,7 +252,7 @@ public void CheckQuestQualification_DependentQuestNotDone_False() bool isQualified = dataQuest.CheckQuestQualification(player); - Assert.IsFalse(isQualified); + Assert.That(isQualified, Is.False); } #endregion CheckQuestQualification @@ -264,7 +264,7 @@ public void IsDoingQuest_SameQuest_True() var actual = dataQuest.IsDoingQuest(dataQuest); - Assert.IsTrue(actual); + Assert.That(actual, Is.True); } [Test] @@ -275,7 +275,7 @@ public void IsDoingQuest_SameQuestAndStepIsZero_False() var actual = dataQuest.IsDoingQuest(dataQuest); - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -289,7 +289,7 @@ public void IsDoingQuest_QuestWithDifferentID_False() var actual = dataQuest.IsDoingQuest(otherDataQuest); - Assert.IsFalse(actual); + Assert.That(actual, Is.False); } [Test] @@ -300,7 +300,7 @@ public void TargetName_Default_EmptyString() var actual = dataQuest.TargetName; var expected = ""; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -313,7 +313,7 @@ public void TargetName_SomeName_SomeName() var actual = dataQuest.TargetName; var expected = "SomeName"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -326,7 +326,7 @@ public void TargetName_FooZeroAndBarZeroOnStep2_Bar() var actual = dataQuest.TargetName; var expected = "Bar"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -340,7 +340,7 @@ public void TargetText_BarPipeBazOnStep2_Baz() var actual = dataQuest.SpyTargetText; var expected = "Baz"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } private FakeQuestPlayer NewFakePlayer() => new FakeQuestPlayer(); diff --git a/Tests/UnitTests/UT_DbConfig.cs b/Tests/UnitTests/UT_DbConfig.cs index 7b606bffe3..5073612227 100644 --- a/Tests/UnitTests/UT_DbConfig.cs +++ b/Tests/UnitTests/UT_DbConfig.cs @@ -31,7 +31,7 @@ public void ConnectionString_NonDefaultOptionSetToValue_NonDefaultOptionEqualVal var actual = dbConfig.ConnectionString; var expected = "NonDefaultOption=Value"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -43,7 +43,7 @@ public void ConnectionString_AddDefaultOptionWithValue_DefaultOptionsEqualValue( var actual = dbConfig.ConnectionString; var expected = "Default Option=Value"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -54,7 +54,7 @@ public void ConnectionString_SetDefaultOptionToAnotherValue_DefaultOptionHasAnot var actual = dbConfig.ConnectionString; var expected = "Default Option=Another Value"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -65,7 +65,7 @@ public void ConnectionString_DefaultOptionWithoutSpaces_DefaultOptionWithSpace() var actual = dbConfig.ConnectionString; var expected = "Default Option="; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -77,7 +77,7 @@ public void ConnectionString_NonDefaultOption_DefaultOptionAtTheEnd() var actual = dbConfig.ConnectionString; var expected = "NonDefaultOption=;Default Option="; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -90,7 +90,7 @@ public void ConnectionString_DefaultOptionWhichIsAddedToSuppressed_DefaultOption var actual = dbConfig.ConnectionString; var expected = ""; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -101,7 +101,7 @@ public void GetValueOf_DEFAULTOPTION_DefaultOptionSetToValue_Value() var actual = dbConfig.GetValueOf("DEFAULTOPTION"); var expected = "Value"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } } diff --git a/Tests/UnitTests/UT_GameEffectList.cs b/Tests/UnitTests/UT_GameEffectList.cs index 1c6d708de1..ef34f4d7fd 100644 --- a/Tests/UnitTests/UT_GameEffectList.cs +++ b/Tests/UnitTests/UT_GameEffectList.cs @@ -19,7 +19,7 @@ public void Add_OwnerIsNotAlive_ReturnFalse() bool actual = effectList.Add(effect); - Assert.AreEqual(false, actual); + Assert.That(actual, Is.EqualTo(false)); } [Test] @@ -33,7 +33,7 @@ public void Add_OwnerIsInactiveObject_ReturnFalse() bool actual = effectList.Add(effect); - Assert.AreEqual(false, actual); + Assert.That(actual, Is.EqualTo(false)); } [Test] @@ -47,7 +47,7 @@ public void Add_OwnerIsActiveObjectAndAlive_ReturnTrue() bool actual = effectList.Add(effect); - Assert.AreEqual(true, actual); + Assert.That(actual, Is.EqualTo(true)); } [Test] @@ -62,7 +62,7 @@ public void Add_ToFreshListAndOwnerIsAliveAndActiveObject_ListCountIsOne() effectList.Add(effect); int actual = effectList.Count; - Assert.AreEqual(1, actual); + Assert.That(actual, Is.EqualTo(1)); } [Test] @@ -76,7 +76,7 @@ public void Add_ToFreshListAndOwnerIsNotAlive_ListCountRemainsZero() effectList.Add(effect); int actual = effectList.Count; - Assert.AreEqual(0, actual); + Assert.That(actual, Is.EqualTo(0)); } [Test] @@ -88,7 +88,7 @@ public void Remove_EffectFromFreshList_ReturnFalse() bool actual = effectList.Remove(effect); - Assert.AreEqual(false, actual); + Assert.That(actual, Is.EqualTo(false)); } [Test] @@ -101,7 +101,7 @@ public void Remove_EffectFromListContainingSameEffect_ReturnTrue() bool actual = effectList.Remove(effect); - Assert.AreEqual(true, actual); + Assert.That(actual, Is.EqualTo(true)); } [Test] @@ -114,7 +114,7 @@ public void Remove_EffectFromListContainingDifferentEffect_ReturnFalse() bool actual = effectList.Remove(effect); - Assert.AreEqual(false, actual); + Assert.That(actual, Is.EqualTo(false)); } [Test] @@ -127,7 +127,7 @@ public void Remove_EffectFromListContainingSameEffect_ListCountIsZero() effectList.Remove(effect); int actual = effectList.Count; - Assert.AreEqual(0, actual); + Assert.That(actual, Is.EqualTo(0)); } [Test] @@ -139,7 +139,7 @@ public void CancelAll_EffectContainsOneEffect_EffectIsCancelled() effectList.CancelAll(); - Assert.IsTrue(effect.receivedCancel); + Assert.That(effect.receivedCancel, Is.True); } [Test] @@ -151,7 +151,7 @@ public void OnEffectsChanged_NoOpenChanges_NPCupdatePetWindowIsCalled() effectList.OnEffectsChanged(null); - Assert.IsTrue(brain.receivedUpdatePetWindow); + Assert.That(brain.receivedUpdatePetWindow, Is.True); } [Test] @@ -164,7 +164,7 @@ public void OnEffectsChanged_OpenChanges_NPCupdatePetWindowIsNotCalled() effectList.BeginChanges(); effectList.OnEffectsChanged(null); - Assert.IsFalse(brain.receivedUpdatePetWindow); + Assert.That(brain.receivedUpdatePetWindow, Is.False); } [Test] @@ -176,7 +176,7 @@ public void CommitChanges_NoOpenChanges_NPCupdatePetWindowIsCalled() effectList.OnEffectsChanged(null); - Assert.IsTrue(brain.receivedUpdatePetWindow); + Assert.That(brain.receivedUpdatePetWindow, Is.True); } [Test] @@ -189,7 +189,7 @@ public void CommitChanges_OpenChanges_NPCupdatePetWindowIsNotCalled() effectList.BeginChanges(); effectList.OnEffectsChanged(null); - Assert.IsFalse(brain.receivedUpdatePetWindow); + Assert.That(brain.receivedUpdatePetWindow, Is.False); } [Test] @@ -200,7 +200,7 @@ public void GetOfType_FreshList_ReturnNull() IGameEffect actual = effectList.GetOfType(); - Assert.AreEqual(null, actual); + Assert.That(actual, Is.EqualTo(null)); } [Test] @@ -212,7 +212,7 @@ public void GetOfType_ListWithOneItemOfGivenType_ReturnListWithThatOneItem() IGameEffect actual = effectList.GetOfType(); - Assert.IsNotNull(actual); + Assert.That(actual, Is.Not.Null); } //RestoreAllEffects calls Database diff --git a/Tests/UnitTests/UT_HereticFocusSpells.cs b/Tests/UnitTests/UT_HereticFocusSpells.cs index c8fbb90617..93759d292a 100644 --- a/Tests/UnitTests/UT_HereticFocusSpells.cs +++ b/Tests/UnitTests/UT_HereticFocusSpells.cs @@ -31,7 +31,7 @@ public void OnDirectEffect_100InitialDamage_NoTick_FirstTickDoes100Damage() var actual = source.LastDamageDealt; var expected = 100; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,7 +53,7 @@ public void OnDirectEffect_100InitialDamageAnd25PercentGrowth_TickTwice_NextTick var actual = source.LastDamageDealt; var expected = 150; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -74,7 +74,7 @@ public void OnDirectEffect_100InitialDamageAnd50PercentGrowth_OneTick_NextTickDo var actual = source.LastDamageDealt; var expected = 150; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -97,7 +97,7 @@ public void OnDirectEffect_100InitialDamageAnd50PercentGrowthAnd70PercentGrowthC var actual = source.LastDamageDealt; var expected = 170; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } private Spell NewHereticFocusDamageSpell(double initialDamage, int growthPercent) diff --git a/Tests/UnitTests/UT_PropertyChangingSpell.cs b/Tests/UnitTests/UT_PropertyChangingSpell.cs index 51efb1100f..7b969ed5df 100644 --- a/Tests/UnitTests/UT_PropertyChangingSpell.cs +++ b/Tests/UnitTests/UT_PropertyChangingSpell.cs @@ -26,7 +26,7 @@ public void ApplyBuffOnTarget_5ResiPierceOnAnotherPlayer_Has5ResiPierceBaseBuffB resiPierceBuff.ApplyEffectOnTarget(target, 1); var actual = target.BaseBuffBonusCategory[eProperty.ResistPierce]; - Assert.AreEqual(5, actual); + Assert.That(actual, Is.EqualTo(5)); } [Test] @@ -42,7 +42,7 @@ public void ApplyEffectOnTarget_50ConBuffOnL50NPC_51Constitution() constitutionBuff.ApplyEffectOnTarget(target, 1); var actual = target.GetModified(eProperty.Constitution); - Assert.AreEqual(51, actual); + Assert.That(actual, Is.EqualTo(51)); } private Spell NewSpellWithValue(int value) diff --git a/Tests/UnitTests/UT_Recipe.cs b/Tests/UnitTests/UT_Recipe.cs index 11348b30dd..f24b245ab9 100644 --- a/Tests/UnitTests/UT_Recipe.cs +++ b/Tests/UnitTests/UT_Recipe.cs @@ -44,7 +44,7 @@ public void GetIngredientCosts_OneIngredientWithPrice2_2() var actual = recipe.CostToCraft; var expected = 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -58,7 +58,7 @@ public void GetIngredientCosts_OneIngredientWithPrice2AndOneWithPrice4_6() var actual = recipe.CostToCraft; var expected = 6; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -72,7 +72,7 @@ public void SetRecommendedProductPriceInDB_ProductWithPrice2AndNoIngredients_Pro var actual = product.Price; var expected = 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -89,7 +89,7 @@ public void SetRecommendedProductPriceInDB_ProductWithPrice2AndIngredientCostIs1 var actual = product.Price; var expected = 95 * 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } @@ -105,7 +105,7 @@ public void Cost_CountIsOneItemPriceIsOne_One() var actual = ingredient.Cost; var expected = 1; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -117,7 +117,7 @@ public void Cost_2ItemsWithPriceOne_2() var actual = ingredient.Cost; var expected = 2; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } } diff --git a/Tests/UnitTests/UT_SpellHandler.cs b/Tests/UnitTests/UT_SpellHandler.cs index ea9f4d764d..6fb196ba8c 100644 --- a/Tests/UnitTests/UT_SpellHandler.cs +++ b/Tests/UnitTests/UT_SpellHandler.cs @@ -27,7 +27,7 @@ public void CastSpell_OnNPCTarget_True() bool isCastSpellSuccessful = spellHandler.CastSpell(target); - Assert.IsTrue(isCastSpellSuccessful); + Assert.That(isCastSpellSuccessful, Is.True); } [Test] @@ -42,8 +42,8 @@ public void CastSpell_OnNPCTarget_CastStartingEventFired() var actual = caster.lastNotifiedEvent; var expected = GameLivingEvent.CastStarting; - Assert.AreEqual(expected, actual); - Assert.AreEqual((caster.lastNotifiedEventArgs as CastingEventArgs).SpellHandler, spellHandler); + Assert.That(actual, Is.EqualTo(expected)); + Assert.That(spellHandler, Is.EqualTo((caster.lastNotifiedEventArgs as CastingEventArgs).SpellHandler)); } [Test] @@ -63,8 +63,8 @@ public void CastSpell_FocusSpell_FiveEventsOnCasterAndOneEventOnTarget() var eventNumberOnCaster = gameEventMgrSpy.GameObjectEventCollection[caster].Count; var eventNumberOnTarget = gameEventMgrSpy.GameObjectEventCollection[target].Count; - Assert.AreEqual(5, eventNumberOnCaster, "Caster has not the right amount of event subscriptions"); - Assert.AreEqual(1, eventNumberOnTarget, "Target has not the right amount of event subscriptions"); + Assert.That(eventNumberOnCaster, Is.EqualTo(5), "Caster has not the right amount of event subscriptions"); + Assert.That(eventNumberOnTarget, Is.EqualTo(1), "Target has not the right amount of event subscriptions"); } [Test] @@ -85,8 +85,8 @@ public void CastSpell_FocusSpellAndCasterMoves_AllEventsRemoved() var eventNumberOnCaster = gameEventMgrSpy.GameObjectEventCollection[caster].Count; var eventNumberOnTarget = gameEventMgrSpy.GameObjectEventCollection[target].Count; - Assert.AreEqual(0, eventNumberOnCaster, "Caster has not the right amount of event subscriptions"); - Assert.AreEqual(0, eventNumberOnTarget, "Target has not the right amount of event subscriptions"); + Assert.That(eventNumberOnCaster, Is.EqualTo(0), "Caster has not the right amount of event subscriptions"); + Assert.That(eventNumberOnTarget, Is.EqualTo(0), "Target has not the right amount of event subscriptions"); } [Test] @@ -104,15 +104,15 @@ public void CastSpell_FocusSpellCastAndTicksOnce_AllEventsRemoved() var spellHandler = new SpellHandler(caster, spell, NewSpellLine()); var gameEventMgrSpy = GameEventMgrSpy.LoadAndReturn(); - Assert.IsTrue(spellHandler.CastSpell(target)); + Assert.That(spellHandler.CastSpell(target), Is.True); target.fakeRegion.fakeElapsedTime = 2; spellHandler.StartSpell(target); //tick caster.OnPlayerMove(); var eventNumberOnCaster = gameEventMgrSpy.GameObjectEventCollection[caster].Count; var eventNumberOnTarget = gameEventMgrSpy.GameObjectEventCollection[target].Count; - Assert.AreEqual(0, eventNumberOnCaster, "Caster has not the right amount of event subscriptions"); - Assert.AreEqual(0, eventNumberOnTarget, "Target has not the right amount of event subscriptions"); + Assert.That(eventNumberOnCaster, Is.EqualTo(0), "Caster has not the right amount of event subscriptions"); + Assert.That(eventNumberOnTarget, Is.EqualTo(0), "Target has not the right amount of event subscriptions"); } [Test] @@ -123,7 +123,7 @@ public void CheckBeginCast_NPCTarget_True() var spellHandler = new SpellHandler(caster, spell, null); bool isBeginCastSuccessful = spellHandler.CheckBeginCast(NewFakeNPC()); - Assert.IsTrue(isBeginCastSuccessful); + Assert.That(isBeginCastSuccessful, Is.True); } #endregion CastSpell @@ -137,7 +137,7 @@ public void CalculateDamageVariance_TargetIsGameLiving_MinIs125Percent() spellHandler.CalculateDamageVariance(target, out double actual, out double ignoredValue); - Assert.AreEqual(1.25, actual); + Assert.That(actual, Is.EqualTo(1.25)); } [Test] @@ -149,7 +149,7 @@ public void CalculateDamageVariance_TargetIsGameLiving_MaxIs125Percent() spellHandler.CalculateDamageVariance(target, out double ignoredValue, out double actual); - Assert.AreEqual(1.25, actual); + Assert.That(actual, Is.EqualTo(1.25)); } [Test] @@ -160,7 +160,7 @@ public void CalculateDamageVariance_SpellLineIsItemEffects_MinIs100Percent() spellHandler.CalculateDamageVariance(null, out double actual, out double ignoredValue); - Assert.AreEqual(1.00, actual); + Assert.That(actual, Is.EqualTo(1.00)); } [Test] @@ -171,7 +171,7 @@ public void CalculateDamageVariance_SpellLineIsCombatStyleEffects_MinIs100Percen spellHandler.CalculateDamageVariance(null, out double actual, out double ignoredValue); - Assert.AreEqual(1.00, actual); + Assert.That(actual, Is.EqualTo(1.00)); } [Test] @@ -182,7 +182,7 @@ public void CalculateDamageVariance_SpellLineIsCombatStyleEffects_MaxIs150Percen spellHandler.CalculateDamageVariance(null, out double ignoredValue, out double actual); - Assert.AreEqual(1.5, actual); + Assert.That(actual, Is.EqualTo(1.5)); } [Test] @@ -193,8 +193,8 @@ public void CalculateDamageVariance_SpellLineIsReservedSpells_MinAndMaxIs100Perc spellHandler.CalculateDamageVariance(null, out double actualMin, out double actualMax); - Assert.AreEqual(1.0, actualMin); - Assert.AreEqual(1.0, actualMax); + Assert.That(actualMin, Is.EqualTo(1.0)); + Assert.That(actualMax, Is.EqualTo(1.0)); } [Test] @@ -210,7 +210,7 @@ public void CalculateDamageVariance_SourceAndTargetLevel30AndSpecLevel16_MinIs75 spellHandler.CalculateDamageVariance(target, out double actual, out double ignoredValue); - Assert.AreEqual(0.75, actual); + Assert.That(actual, Is.EqualTo(0.75)); } [Test] @@ -226,7 +226,7 @@ public void CalculateDamageVariance_SameLevelButNoSpec_MinIs25Percent() spellHandler.CalculateDamageVariance(target, out double actual, out double ignoredValue); - Assert.AreEqual(0.25, actual); + Assert.That(actual, Is.EqualTo(0.25)); } [Test] @@ -242,7 +242,7 @@ public void CalculateDamageVariance_SameLevelButFiveSpecLevelOverTargetLevel_Min spellHandler.CalculateDamageVariance(target, out double actual, out double ignoredValue); - Assert.AreEqual(1.27, actual); + Assert.That(actual, Is.EqualTo(1.27)); } [Test] @@ -258,7 +258,7 @@ public void CalculateDamageVariance_NoSpecButSourceHasTwiceTheTargetLevel_MinIs5 spellHandler.CalculateDamageVariance(target, out double actual, out double ignoredValue); - Assert.AreEqual(0.55, actual); + Assert.That(actual, Is.EqualTo(0.55)); } [Test] @@ -274,7 +274,7 @@ public void CalculateDamageVariance_NoSpecButSourceHasTwiceTheTargetLevel_MaxIs1 spellHandler.CalculateDamageVariance(target, out double ignoredValue, out double actual); - Assert.AreEqual(1.55, actual); + Assert.That(actual, Is.EqualTo(1.55)); } #endregion CalculateDamageVariance @@ -292,7 +292,7 @@ public void CalculateDamageBase_SpellDamageIs100AndCombatStyleEffect_ReturnAroun double actual = spellHandler.CalculateDamageBase(target); double expected = 100 * (0 + 200) / 275.0; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -310,7 +310,7 @@ public void CalculateDamageBase_SpellDamageIs100SourceIsCasterWith100ManaStat_Re double actual = spellHandler.CalculateDamageBase(target); double expected = 100 * (100 + 200) / 275.0; - Assert.AreEqual(expected, actual, 0.001); + Assert.That(actual, Is.EqualTo(expected).Within(0.001)); } [Test] @@ -334,7 +334,7 @@ public void CalculateDamageBase_SpellDamageIs100SourceIsCasterPetWith100ManaStat double actual = spellHandler.CalculateDamageBase(target); double expected = 100 * (100 + 200) / 275.0 * (100 + 200) / 275.0; - Assert.AreEqual(expected, actual, 0.001); + Assert.That(actual, Is.EqualTo(expected).Within(0.001)); } [Test] @@ -353,7 +353,7 @@ public void CalculateDamageBase_SpellDamageIs100FromGameNPCWithoutOwner_ReturnAr double actual = spellHandler.CalculateDamageBase(target); double expected = 100 * (100 + 200) / 275.0; - Assert.AreEqual(expected, actual, 0.001); + Assert.That(actual, Is.EqualTo(expected).Within(0.001)); } #endregion CalculateDamageBase @@ -369,7 +369,7 @@ public void CalculateToHitChance_BaseChance_Return85() int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(85, actual); + Assert.That(actual, Is.EqualTo(85)); } [Test] @@ -385,7 +385,7 @@ public void CalculateToHitChance_SpellLevelIs50TargetLevelIsZero_Return110() int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(110, actual); + Assert.That(actual, Is.EqualTo(110)); } [Test] @@ -400,7 +400,7 @@ public void CalculateToHitChance_SpellBonusIsTen_Return90() int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(90, actual); + Assert.That(actual, Is.EqualTo(90)); } [Test] @@ -415,7 +415,7 @@ public void CalculateToHitChance_SpellBonusIsSeven_Return88() int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(88, actual); + Assert.That(actual, Is.EqualTo(88)); } [Test] @@ -433,7 +433,7 @@ public void CalculateToHitChance_SourceSpellBonusIsTenSpellLevelAndTargetLevelAr int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(85, actual); + Assert.That(actual, Is.EqualTo(85)); } [Test] @@ -451,7 +451,7 @@ public void CalculateToHitChance_SameTargetAndSpellLevelWithFiveToHitBonus_Retur int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(90, actual); + Assert.That(actual, Is.EqualTo(90)); } [Test] @@ -470,7 +470,7 @@ public void CalculateToHitChance_TargetIsNPCLevel50SourceIsLevel50PlayerAndSpell int actual = spellHandler.CalculateToHitChance(target); - Assert.AreEqual(80, actual); + Assert.That(actual, Is.EqualTo(80)); } #endregion diff --git a/Tests/UnitTests/UT_Util.cs b/Tests/UnitTests/UT_Util.cs index aaf2dea73a..4f27e131a1 100644 --- a/Tests/UnitTests/UT_Util.cs +++ b/Tests/UnitTests/UT_Util.cs @@ -12,6 +12,6 @@ public void SplitCSV_EmptyString_EmptyList() { var actual = Util.SplitCSV(""); var expected = new List(); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } \ No newline at end of file diff --git a/Tests/UnitTests/UT_WhereClause.cs b/Tests/UnitTests/UT_WhereClause.cs index 1f6ecba146..c2df585516 100644 --- a/Tests/UnitTests/UT_WhereClause.cs +++ b/Tests/UnitTests/UT_WhereClause.cs @@ -31,7 +31,7 @@ public void ParameterizedText_KeyIsEqualToOne_KeyEqualAtA() { var expression = DB.Column("key").IsEqualTo(1); - Assert.AreEqual("WHERE key = @a", expression.ParameterizedText); + Assert.That(expression.ParameterizedText, Is.EqualTo("WHERE key = @a")); } [Test] @@ -40,7 +40,7 @@ public void Parameters_KeyColumnIsEqualToOne_FirstQueryParameterValueIsOne() var expression = DB.Column("key").IsEqualTo(1); var firstQueryParameter = expression.Parameters[0]; - Assert.AreEqual(firstQueryParameter.Value, 1); + Assert.That(1, Is.EqualTo(firstQueryParameter.Value)); } [Test] @@ -53,7 +53,7 @@ public void ParameterizedText_FooIsEqualToOneAndBarIsEqualToOne_WhereFooEqualAtA var actual = andExpression.ParameterizedText; var expected = $"WHERE ( foo = @a AND bar = @b )"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -64,7 +64,7 @@ public void ParameterizedText_FooIsInOneAndTwo_FooIsInAtACommaAtB() var placeHolder2 = expr.Parameters[1].Item1; var actual = expr.ParameterizedText; var expected = $"WHERE foo IN ( {placeHolder1} , {placeHolder2} )"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -75,7 +75,7 @@ public void ParameterizedText_FooIsInAandB_FooIsInAtACommaAtB() var placeHolder2 = expr.Parameters[1].Item1; var actual = expr.ParameterizedText; var expected = $"WHERE foo IN ( {placeHolder1} , {placeHolder2} )"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -84,7 +84,7 @@ public void ParameterizedText_FooIsInEmptyArray_WhereFalse() var expr = DB.Column("foo").IsIn(Array.Empty()); var actual = expr.ParameterizedText; var expected = $"WHERE false"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -93,7 +93,7 @@ public void ParameterizedText_FooIsNotInEmptyArray_WhereTrue() var expr = DB.Column("foo").IsNotIn(Array.Empty()); var actual = expr.ParameterizedText; var expected = $"WHERE true"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -106,7 +106,7 @@ public void Parameters_Expression1AndExpression2_ConcatenationOfBothParameters() var actual = andExpression.Parameters; var expected = new[] { new QueryParameter("@a", 1), new QueryParameter("@b", 2) }; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -116,7 +116,7 @@ public void ParameterizedText_EmptyWhereClause_EmptyString() var actual = expression.ParameterizedText; var expected = string.Empty; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -125,7 +125,7 @@ public void Parameters_EmptyWhereClause_Empty() var expression = WhereClause.Empty; var actual = expression.Parameters; - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Test] @@ -138,7 +138,7 @@ public void And_EmptyAndFilterExpression_EqualsFilterExpression() var actual = andExpression; var expected = filterExpression; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -151,7 +151,7 @@ public void And_FilterExpressionAndEmpty_EqualsFilterExpression() var actual = andExpression; var expected = filterExpression; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -161,7 +161,7 @@ public void EmptyExpression_AndEmptyExpression_OnlyFilterExpression() var actual = andExpression.ParameterizedText; var expected = string.Empty; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -169,7 +169,7 @@ public void ParameterizedText_DBColumnFooIsNull_WhereFooIsNull() { var actual = DB.Column("Foo").IsNull().ParameterizedText; var expected = "WHERE Foo IS NULL"; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -187,7 +187,7 @@ public void DBColumn_EmptyString_ThrowArgumentException() [Test] public void Equals_TwoFreshEmptyWhereClauses_True() { - Assert.IsTrue(WhereClause.Empty.Equals(WhereClause.Empty)); + Assert.That(WhereClause.Empty.Equals(WhereClause.Empty), Is.True); } [Test] @@ -196,7 +196,7 @@ public void Equals_TwoFilterExpressionsWithSameProperties_True() var expression1 = DB.Column("foo").IsEqualTo(1); var expression2 = DB.Column("foo").IsEqualTo(1); - Assert.IsTrue(expression1.Equals(expression2)); + Assert.That(expression1.Equals(expression2), Is.True); } [Test] @@ -205,7 +205,7 @@ public void Equals_TwoFilterExpressionsWithOnlyDifferentValue_False() var expression1 = DB.Column("foo").IsEqualTo(0); var expression2 = DB.Column("foo").IsEqualTo(1); - Assert.IsFalse(expression1.Equals(expression2)); + Assert.That(expression1.Equals(expression2), Is.False); } [Test] @@ -214,7 +214,7 @@ public void Equals_TwoFilterExpressionsWithOnlyDifferentColumnName_False() var expression1 = DB.Column("foo").IsEqualTo(1); var expression2 = DB.Column("bar").IsEqualTo(1); - Assert.IsFalse(expression1.Equals(expression2)); + Assert.That(expression1.Equals(expression2), Is.False); } [Test] @@ -223,7 +223,7 @@ public void Equals_TwoFilterExpressionsWithOnlyDifferentOperator_False() var expression1 = DB.Column("foo").IsEqualTo(1); var expression2 = DB.Column("foo").IsNotEqualTo(1); - Assert.IsFalse(expression1.Equals(expression2)); + Assert.That(expression1.Equals(expression2), Is.False); } [Test] @@ -233,7 +233,7 @@ public void Equals_TwoAndExpressionsWithSameExpressions_True() var andExpression1 = filterExpression.And(filterExpression); var andExpression2 = filterExpression.And(filterExpression); - Assert.IsTrue(andExpression1.Equals(andExpression2)); + Assert.That(andExpression1.Equals(andExpression2), Is.True); } [Test] @@ -243,7 +243,7 @@ public void Equals_AndExpressionsAndOrExpressionWithSameExpressions_False() var andExpression = filterExpression.And(filterExpression); var orExpression = filterExpression.Or(filterExpression); - Assert.IsFalse(andExpression.Equals(orExpression)); + Assert.That(andExpression.Equals(orExpression), Is.False); } } }