static Honeypot() { SetDefaults(); InputNames = new HoneypotInputNameCollection(); Worker = new HoneypotWorker(); CustomRules = new HoneypotRuleCollection(); }
public void Add_ShouldThorwArgumentException_WhenPassedEmptyString() { string str = string.Empty; var collection = new HoneypotInputNameCollection(); Assert.Throws <ArgumentException>(() => collection.Add(str)); }
public static void RegisterHoneypotInputNames(HoneypotInputNameCollection collection) { //Honeypot will use 2 words at random to create the input name {0}-{1} collection.Add(new[] { "User", "Name", "Age", "Question", "List", "Why", "Type", "Phone", "Fax", "Custom", "Relationship", "Friend", "Pet", "Reason" }); //This is optional, if you don't want the honeypot input to generate a random input name per request //You can skip adding any items to the collection and set a DefaultInputName (default: Phone-Data-Home) //Honeypot.SetDefaultInputName("NewDefaultInputName"); }
public void Remove_ShouldThorwArgumentException_WhenPassedEmptyString() { string str = string.Empty; var collection = new HoneypotInputNameCollection(); Assert.Throws<ArgumentException>(() => collection.Remove(str)); }
public void Add_ShouldThorwArgumentException_WhenPassedNull() { string str = null; var collection = new HoneypotInputNameCollection(); Assert.Throws<ArgumentException>(() => collection.Add(str)); }
public void Remove_ShouldThorwArgumentException_WhenPassedNull() { string str = null; var collection = new HoneypotInputNameCollection(); Assert.Throws <ArgumentException>(() => collection.Remove(str)); }
public void Add_ShouldAddAllStringsInCollection_WhenPassedAnyInitializedIEnumerableOfString() { var arr = new[] {"Mock 1", "Mock 2", "Mock 3"}; var collection = new HoneypotInputNameCollection(); collection.Add(arr); Assert.Equal(3, collection.Count); }
public void Add_ShouldAddAllStringsInCollection_WhenPassedAnyInitializedIEnumerableOfString() { var arr = new[] { "Mock 1", "Mock 2", "Mock 3" }; var collection = new HoneypotInputNameCollection(); collection.Add(arr); Assert.Equal(3, collection.Count); }
public void Remove_ShouldRemoveGivenStringFromCollection_WhenPassedAValidString() { string str = "Mock String"; var collection = new HoneypotInputNameCollection(); collection.Add(str); Assert.Equal(1, collection.Count); collection.Remove(str); Assert.Equal(0, collection.Count); }
public void Clear_ShouldRemoveAllEntriesInCollection() { var arr = new[] {"Mock 1", "Mock 2", "Mock 3"}; var collection = new HoneypotInputNameCollection(); collection.Add(arr); Assert.Equal(3, collection.Count); collection.Clear(); Assert.Equal(0, collection.Count); }
public void Add_WillPlaceStringInCollection_WhenPassedAValidString() { string str = "Mock String"; var collection = new HoneypotInputNameCollection(); collection.Add(str); string filterName = collection.First(); Assert.Equal(1, collection.Count); Assert.Equal(str, filterName); }
public void Clear_ShouldRemoveAllEntriesInCollection() { var arr = new[] { "Mock 1", "Mock 2", "Mock 3" }; var collection = new HoneypotInputNameCollection(); collection.Add(arr); Assert.Equal(3, collection.Count); collection.Clear(); Assert.Equal(0, collection.Count); }
public void Remove_ShouldRemoveGivenStringFromCollection_WhenPassedAValidString() { string str = "Mock String"; var collection = new HoneypotInputNameCollection(); collection.Add(str); Assert.Equal(1, collection.Count); collection.Remove(str); Assert.Equal(0, collection.Count); }
public void Add_WillPlaceStringInCollection_WhenPassedAValidString() { string str = "Mock String"; var collection = new HoneypotInputNameCollection(); collection.Add(str); string filterName = collection.First(); Assert.Equal(1, collection.Count); Assert.Equal(str, filterName); }
public static void RegisterHoneypotInputNames(HoneypotInputNameCollection collection) { //Honeypot will use 2 words to create the input name {0}-{1} collection.Add(new[] { "User", "Name", "Age", "Question", "List", "Why", "Type", "Phone", "Fax", "Custom", "Relationship", "Friend", "Pet", "Reason" }); }
public static void RegisterHoneypotInputNames(HoneypotInputNameCollection collection) { //Honeypot will use 2 words to create the input name {0}-{1} collection.Add(new[] { "User", "Name", "Age", "Question", "List", "Why", "Type", "Phone", "Fax", "Custom", "Relationship", "Friend", "Pet", "Reason" }); }
static Honeypot() { InputNames = new HoneypotInputNameCollection(); CssClassName = "input-imp-long"; DefaultInputName = "Phone-Data-Home"; }
static Honeypot() { InputNames = new HoneypotInputNameCollection(); CssClassName = "input-imp-long"; }