/// <summary> /// This is an helper method to verify device class classification. /// </summary> /// <param name="deviceClass">The deviceClass<see cref="DeviceClass"/></param> /// <param name="human">If the device is used by a human (like a browser)</param> /// <param name="mobile">If the device is mobile</param> /// <param name="normal">If its a normal consumer device.</param> /// <param name="misuse">If this user agent is a misuse like an hacker.</param> private void VerifyDeviceClass(DeviceClass deviceClass, bool human, bool mobile, bool normal, bool misuse) { var userAgent = new UserAgent(); userAgent.Set(UserAgent.DEVICE_CLASS, deviceClass.GetValue(), 1); UserAgentClassifier.IsHuman(userAgent).Should().Be(human, "For the DeviceClass " + deviceClass.ToString() + " the isHuman() should be correct"); UserAgentClassifier.IsMobile(userAgent).Should().Be(mobile, "For the DeviceClass " + deviceClass.ToString() + " the isMobile() should be correct"); UserAgentClassifier.IsNormalConsumerDevice(userAgent).Should().Be(normal, "For the DeviceClass " + deviceClass.ToString() + " the isNormalConsumerDevice() should be correct"); UserAgentClassifier.IsDeliberateMisuse(userAgent).Should().Be(misuse, "For the DeviceClass " + deviceClass.ToString() + " the isDeliberateMisuse() should be correct"); }