public void DoesNotReviveNullOrEmptyOrWhiteSpaceOrInvalidOrUnknownOrUnsupportedTypesAndDoesNotThrowException() { var actualNullType = ShardKeyTypeArgReviver.Revive(null, null); Assert.IsNull(actualNullType); var actualEmptyStringType = ShardKeyTypeArgReviver.Revive(null, ""); Assert.IsNull(actualEmptyStringType); var actualWhiteSpaceType = ShardKeyTypeArgReviver.Revive(null, "\t"); Assert.IsNull(actualWhiteSpaceType); var actualInvalidType = ShardKeyTypeArgReviver.Revive(null, "Invalid"); // this maps to 0 in the enum Assert.IsNull(actualInvalidType); var actualUnknownType = ShardKeyTypeArgReviver.Revive(null, "Widget"); // not a real thing Assert.IsNull(actualUnknownType); var actualUnsupportedType = ShardKeyTypeArgReviver.Revive(null, "Long"); // not currently supported by Sharding.App (though it is supported by SqlAzure Sharding) Assert.IsNull(actualUnsupportedType); }
public void CorrectRevivesAllSupportedTypesIgnoringCase() { var actualGuidType = ShardKeyTypeArgReviver.Revive(null, "GUID"); Assert.IsNotNull(actualGuidType); Assert.AreEqual(typeof(Guid), actualGuidType); var actualIntType = ShardKeyTypeArgReviver.Revive(null, "INT"); Assert.IsNotNull(actualIntType); Assert.AreEqual(typeof(int), actualIntType); }