DotNetMigrations.Migrations.MigrationScriptFile.Equals C# (CSharp) Method

Equals() public method

public Equals ( MigrationScriptFile other ) : bool
other MigrationScriptFile
return bool
        public bool Equals(MigrationScriptFile other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other.Version == Version;
        }

Same methods

MigrationScriptFile::Equals ( object obj ) : bool

Usage Example

        public void Equals_should_find_two_with_the_same_FilePath_equal()
        {
            //  arrange
            const string path1 = "C:\\test\\123_my_migration_script.sql";
            var script1 = new MigrationScriptFile(path1);

            const string path2 = "C:\\test\\123_my_migration_script.sql";
            var script2 = new MigrationScriptFile(path2);

            //  act
            bool result = script1.Equals(script2);

            //  assertS
            Assert.IsTrue(result);
        }