public void GetHoneypotData_ShouldReturnHoneypotDefaultInputValue_WhenInputNamesCollectionCountIsLessThanTwo() { // Arrange var worker = new HoneypotWorker(); Honeypot.InputNames.Clear(); //Act HoneypotData token = worker.GetHoneypotData(MvcHelper.GetHttpContext()); //Assert Assert.Equal(token.InputNameValue, HoneypotData.DefaultFieldName); }
public void GetHoneypotData_ShouldReturnRandomInputName_WhenInputNamesCollectionCountIsGreaterThanOne() { // Arrange var worker = new HoneypotWorker(); Honeypot.InputNames.Add("test"); Honeypot.InputNames.Add("name"); // Act HoneypotData token = worker.GetHoneypotData(MvcHelper.GetHttpContext()); // Assert Assert.NotEqual(token.InputNameValue, HoneypotData.DefaultFieldName); }