public void RunTest02() { IsUnique test = new IsUnique("This one will fail."); var result = test.Run(); Assert.IsFalse(result); }
public void RunTest05() { IsUnique test = new IsUnique("Dud"); var result = test.Run(); Assert.IsFalse(result); }
public void RunTest04() { IsUnique test = new IsUnique(null); var result = test.Run(); Assert.IsTrue(result); }
public void IsUniqueSolution() { foreach (var item in _expected) { Assert.Equal(item.Item2, IsUnique.IsUniqueSolution(item.Item1)); } }
public void IsUniqueInPlaceTest(string input, bool expectedResult) { var inputFormatted = input.ToCharArray().ToList(); var result = IsUnique.RunInPlace(inputFormatted); Assert.Equal(expectedResult, result); }
public void EvaluateShouldReturnTrueOrFalseWhenGivenAnyString(string any, bool expected) { IsUnique isUnique = new IsUnique(); bool actual = isUnique.Evaluate(any); Assert.Equal(expected, actual); }
public void RunTest01() { IsUnique test = new IsUnique("It works!"); var result = test.Run(); Assert.IsTrue(result); }
static void Main(string[] args) { var test = "helo"; var a = new IsUnique(); System.Console.WriteLine(a.IsUniqueElement(test)); }
public void FirstTry_The_String_Has_All_Unique_Characters() { string myString = "abcdefgh"; bool result = new IsUnique().FirstTry(myString); Assert.True(result); }
public void MyTry_Vafzmora_The_String_Has_A_Duplicate_Character() { string myString = "abcdebfgh"; bool result = new IsUnique().MyTry_Vafzmora(myString); Assert.False(result); }
public void SecondTry_The_String_Has_A_Duplicate_Character() { string myString = "abcdebfgh"; bool result = new IsUnique().SecondTry(myString); Assert.False(result); }
public void MyTry_Vafzmora_The_String_Has_All_Unique_Characters() { string myString = "abcdefgh"; bool result = new IsUnique().MyTry_Vafzmora(myString); Assert.True(result); }
public override int GetHashCode() { unchecked { var hashCode = Name?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ IsUnique.GetHashCode(); return(hashCode); } }
public bool Equals(IndexOptions other) { return(!ReferenceEquals(null, other) && IsUnique.Equals(other.IsUnique) && WhenStringThenIgnoreCase.Equals(other.WhenStringThenIgnoreCase) && WhenDateThenIgnoreTimeOfDay.Equals(other.WhenDateThenIgnoreTimeOfDay) && (IncludeValues ?? Enumerable.Empty <object>()).SequenceEqual(other.IncludeValues ?? Enumerable.Empty <object>()) && (ExcludeValues ?? Enumerable.Empty <object>()).SequenceEqual(other.ExcludeValues ?? Enumerable.Empty <object>())); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { unchecked { int result = IsUnique.GetHashCode(); result = (result * 397) ^ (HashIndexedProps != null ? Collections.GetHashCode(HashIndexedProps) : 0); result = (result * 397) ^ (RangeIndexedProps != null ? Collections.GetHashCode(RangeIndexedProps) : 0); return(result); } }
public override int GetHashCode() { unchecked { var hashCode = (_displayName != null ? _displayName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DataType != null ? DataType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ IsUnique.GetHashCode(); return(hashCode); } }
public void IsUniqueTest(string input, bool expectedResult) { var result = IsUnique.Run(input); Assert.Equal(expectedResult, result); }
public void initializeIsUnique() { _str = new IsUnique(); }
public string GetPropertiesAsXml() { StringBuilder sbResult = new StringBuilder(); sbResult.Append("<" + (String.IsNullOrEmpty(ColumnName) ? "_" : ColumnName) + GetRegexProperties()); if (!String.IsNullOrEmpty((PrecedingRegEx ?? "").TrimEnd('"'))) { sbResult.Append(" Prefix = '" + PrecedingRegEx + "'"); } if (!String.IsNullOrEmpty((TrailingRegEx ?? "").TrimEnd('"'))) { sbResult.Append(" Suffix = '" + TrailingRegEx + "'"); } if (ColumnType != RegexColumnType.STRING) { sbResult.Append(" Type = '" + ColumnType.ToString() + "'"); } if (!String.IsNullOrEmpty(ValueMatchingCondition)) { sbResult.Append(" Condition = '" + ValueMatchingCondition + "'"); } if (AutoIncrement) { sbResult.Append(" AutoIncrement = '" + AutoIncrement.ToString() + "'"); } if (AutoIncrement) { sbResult.Append(" StartValue = '" + StartValue.ToString() + "'"); } if (AutoIncrement) { sbResult.Append(" Increment = '" + Increment.ToString() + "'"); } if (!String.IsNullOrEmpty(Expression)) { sbResult.Append(" Expression = '" + Expression + "'"); } if (IsForeignKey) { sbResult.Append(" ForeignKey = '" + IsForeignKey.ToString() + "'"); } if (IsUnique) { sbResult.Append(" PrimaryKey = '" + IsUnique.ToString() + "'"); } if (!String.IsNullOrEmpty(DisplayName)) { sbResult.Append(" DisplayName = '" + DisplayName + "'"); } if (!String.IsNullOrEmpty(Description)) { sbResult.Append(" Description = '" + Description + "'"); } if (!String.IsNullOrEmpty(Default)) { sbResult.Append(" Default = '" + Default + "'"); } sbResult.Append(" />"); return(sbResult.ToString()); }
public void Test2() { var actual = IsUnique.SolutionWithDictionary("test"); Assert.AreEqual(false, actual); }
public void GetsString_ReturnsUniqueness(string inputString, bool result) { Assert.Equal(IsUnique.IsUniqueLinear(inputString), result); }
static void Main(string[] args) { var text = "asas"; Console.WriteLine($"Is Uniqie : {text} - {IsUnique.solve(text.ToCharArray())}"); }
public void Test22() { var actual = IsUnique.SolutionWithoutAdditionalDataStructure("test"); Assert.AreEqual(false, actual); }
public void IsUniqueUsingArray_Test() { IsUnique.IsUniqueUsingArray("qwerasdzxco,nkl;p$!@(&*^").Should().BeTrue(); IsUnique.IsUniqueUsingArray("qwerasdzxcFFo,nklo;p$!@(&*^").Should().BeFalse(); }
public void Setup() { isUnique = new IsUnique(); }
public void Test1() { var actual = IsUnique.SolutionWithDictionary("tes"); Assert.AreEqual(true, actual); }
public void Test32() { var actual = IsUnique.SolutionWithoutAdditionalDataStructure("tes1234567"); Assert.AreEqual(true, actual); }
public void IsUniqueUsingBitVector() { IsUnique.IsUniqueUsingBitVector("qwerasdzxcoZAIUWPOMCNB").Should().BeTrue(); IsUnique.IsUniqueUsingBitVector("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ").Should().BeTrue(); IsUnique.IsUniqueUsingArray("qwerasdzxcoAZAIUWPMPOMCNB").Should().BeFalse(); }