Project Description
Low level unit testing sucks. It sucks even more when you realize for every 100 properties that you test only one of them is going to have a bug. A nasty, impossible to find bug, that prompted your lead to have you write the stupid property tests in the first place.

Test Monkey is an automatic Unit Test Generator for .NET/Silverlight. It is designed to write the trivial unit tests that, while very valuable, are incredibly tedious to write manually.


Test Monkey Basic Tests

Construtors

  • All constructors are successful or throw ArgumentException

Properties

  • Setting a value will throw an ArgumentException or set the value
  • Setting a value to itself will not throw
  • Setting a value to null will throw an ArgumentNullException or set the value (Exception, strings can be changed from null to "")
  • Reading a property twice in a row will return the same value both times.

Memory

  • Creating and then nulling an object will allow it to be garbage collected.

Test Monkey Interface Tests

IBindingList

  • AllowNew/AddNew Pair

ICloneable

  • Clone doesn't throw
  • New properties are equal to original

IComparable and IComparable<T>

  • IComparable.Compare (equals, greater-than, and less-than)
  • IComparable.Compare null check
  • IComparable<T>.Compare (equals, greater-than, and less-than)
  • IComparable<T>.Compare null check (if applicable)

IDisposable

  • Base case doesn't throw
  • Calling a second time doesn't throw
  • Repeat with each constructor

IEditableObject

  • Begin/End pair doesn't throw
  • Begin/Cancel pair doesn't throw

IEquatable<T>

  • IEquatable.Equals (equals, not equals)
  • IEquatable.Equals null check (if applicable)
  • object.Equals(object)
  • object.GetHashCode
  • Object.Equals(object, object)

INotifyPropertyChanged

  • Raises an event when the value changes
  • Doesn't eaise an event for an unchanged being set. (Note, other properties may be raised. This is to support calculated properties where you don't want the expense of seeing if they actaully changed.)



Last edited Jul 14, 2011 at 12:31 AM by Grauenwolf, version 4