public void IsMigrationItemEqualsToHistory() { //arrange var step = new TestStep(ExecutionResult.Success); var positiveCaseStepName = MigrationHandler.StepIdentity(step); var positiveCaseVersion = new Version("1.2.3.4"); var negativeCaseVersion = new Version("4.3.2.1"); var migrationItem = new MigrationItem(positiveCaseVersion, new TestStep(ExecutionResult.Success)); var migrationHistory = new MigrationHistory { Name = positiveCaseStepName, Version = positiveCaseVersion.ToString() }; //act var positiveCase = MigrationHandler.IsMigrationItemEqualsToHistory(migrationItem, migrationHistory); migrationHistory.Version = negativeCaseVersion.ToString(); var negativeCase1 = MigrationHandler.IsMigrationItemEqualsToHistory(migrationItem, migrationHistory); migrationHistory.Version = positiveCaseVersion.ToString(); migrationHistory.Name = String.Empty; var negativeCase2 = MigrationHandler.IsMigrationItemEqualsToHistory(migrationItem, migrationHistory); //assert Assert.True(positiveCase && !negativeCase1 && !negativeCase2); }
public static MigrationHistory MigrationHistory(Version ver) => new MigrationHistory { Name = MigrationHandler.StepIdentity(new TestStep(ExecutionResult.Success)), Version = ver.ToString() };