public void DbSourceDefinition_GetHashCode_Not_Equal_To_Zero() { const AuthenticationType expectedAuthenticationType = AuthenticationType.Public; const string expectedDatabaseName = "warewolfDb"; const string expectedPassword = "******"; const string expectedServer = "localhost"; const int expectedConnectionTimeout = 30; const enSourceType expectedServerType = enSourceType.SqlDatabase; const string expectedUserId = "userId"; var mockDb = new Mock <IDb>(); mockDb.Setup(db => db.Server).Returns(expectedServer); mockDb.Setup(db => db.ServerType).Returns(expectedServerType); mockDb.Setup(db => db.UserID).Returns(expectedUserId); mockDb.Setup(db => db.Password).Returns(expectedPassword); mockDb.Setup(db => db.AuthenticationType).Returns(expectedAuthenticationType); mockDb.Setup(db => db.ConnectionTimeout).Returns(expectedConnectionTimeout); mockDb.Setup(db => db.DatabaseName).Returns(expectedDatabaseName); var dbSourceDefinition = new DbSourceDefinition(mockDb.Object); var hashCode = dbSourceDefinition.GetHashCode(); Assert.AreNotEqual(0, hashCode); }
public void DbSourceDefinition_GetHashCode_Expect_Zero() { var mockDb = new Mock <IDb>(); var dbSourceDefinition = new DbSourceDefinition(mockDb.Object); var hashCode = dbSourceDefinition.GetHashCode(); Assert.AreEqual(0, hashCode); }