public void CheckFileMoveWithAdd_DiffDest() { var actions = new List <FileModification>() { new AddFileModification(exampleFile2, false, "Test.Add") }; var mod = new GameModification() { Config = new Data.BaseModConfiguration() { ModID = "Test.Move" } }; bool hasCollision = ModCollisionTracker.HasMoveCollision(mod, exampleFile3, exampleFile1, actions, out var collision); Assert.AreEqual(false, hasCollision); }
public void CheckFileMoveWithMove_SameTarget() { var actions = new List <FileModification>() { new MoveFileModification(exampleFile1, exampleDestination1, false, "Test.Move") }; var mod = new GameModification() { Config = new Data.BaseModConfiguration() { ModID = "Test.Move2" } }; bool hasCollision = ModCollisionTracker.HasMoveCollision(mod, exampleFile1, exampleDestination1, actions, out var collision); Assert.AreEqual(false, hasCollision); }
public void CheckFileMoveWithAdd_SameDest() { var actions = new List <FileModification>() { new AddFileModification(exampleFile1, false, "Test.Add") }; var mod = new GameModification() { Config = new Data.BaseModConfiguration() { ModID = "Test.Move" } }; bool hasCollision = ModCollisionTracker.HasMoveCollision(mod, exampleFile2, exampleFile1, actions, out var collision); Assert.AreEqual(true, hasCollision); Assert.AreEqual(collision.severity, ModCollisionSeverity.Clash); Assert.AreEqual(collision.modID, "Test.Add"); Assert.IsTrue(collision.description.Contains("Attempting to move a file to a destination that has been modified by another mod (with different data)"), $"Actual: {collision.description}"); }
public void CheckFileMoveWithWrite() { var actions = new List <FileModification>() { new EditFileModification(exampleFile1, false, "Test.Edit") }; var mod = new GameModification() { Config = new Data.BaseModConfiguration() { ModID = "Test.Move2" } }; bool hasCollision = ModCollisionTracker.HasMoveCollision(mod, exampleFile1, exampleDestination1, actions, out var collision); Assert.AreEqual(true, hasCollision); Assert.AreEqual(collision.severity, ModCollisionSeverity.Clash); Assert.AreEqual(collision.modID, "Test.Edit"); Assert.IsTrue(collision.description.Contains("Attempting to move a file that has been written to by another mod"), $"Actual: {collision.description}"); }