示例#1
0
        public void CheckFileReplaceWithReplace_SameData()
        {
            var actions = new List <FileModification>()
            {
                new ReplaceFileModification(exampleDestination1, false, "Test.Replace1")
            };

            var mod = new GameModification()
            {
                Config = new Data.BaseModConfiguration()
                {
                    ModID = "Test.Replace2"
                }
            };
            bool hasCollision = ModCollisionTracker.HasReplaceCollision(mod, exampleFile1, exampleDestination3_exampleDestination1, actions, out var collision);

            Assert.AreEqual(false, hasCollision);
        }
示例#2
0
        public void CheckFileReplaceWithReplace_DifferentData()
        {
            var actions = new List <FileModification>()
            {
                new ReplaceFileModification(exampleFile1, false, "Test.Replace1")
            };

            var mod = new GameModification()
            {
                Config = new Data.BaseModConfiguration()
                {
                    ModID = "Test.Replace2"
                }
            };
            bool hasCollision = ModCollisionTracker.HasReplaceCollision(mod, exampleFile1, testFile2, actions, out var collision);

            Assert.AreEqual(true, hasCollision);
            Assert.AreEqual(collision.severity, ModCollisionSeverity.Clash);
            Assert.AreEqual(collision.modID, "Test.Replace1");
            Assert.IsTrue(collision.description.Contains("Attempting to replace a file that has been replaced by another mod (with different data)"), $"Actual: {collision.description}");
        }
示例#3
0
        public void CheckFileReplaceWithMove()
        {
            var actions = new List <FileModification>()
            {
                new MoveFileModification(exampleFile1, "C:\\Example\\ExampleFile.txt", false, "Test.Move")
            };

            var mod = new GameModification()
            {
                Config = new Data.BaseModConfiguration()
                {
                    ModID = "Test.Replace"
                }
            };
            bool hasCollision = ModCollisionTracker.HasReplaceCollision(mod, exampleFile1, exampleFile2, actions, out var collision);

            Assert.AreEqual(true, hasCollision);
            Assert.AreEqual(collision.severity, ModCollisionSeverity.Clash);
            Assert.AreEqual(collision.modID, "Test.Move");
            Assert.IsTrue(collision.description.Contains("Attempting to replace a file that has been moved by another mod"), $"Actual: {collision.description}");
        }