From the reading of your question, you either misunderstand what a POCO is, or you misunderstand unit testing.
A POCO is just an old fashioned object. It has state and behavior. You unit test the state by putting (setting) values in to the properties, and asserting that the value is what you expected. You unit test behavior by asserting expectations against methods.
Here would be an oversimplified example of a POCO and its tests. Notice that there's more test code than implementation code. When unit testing is done right (TDD), this is the case.
public class Person
{
private Name name = Name.Empty;
private Address address = Address.Empty;
private bool canMove;
public Name Name
{
set { name = value; }
get { return name; }
}
public Address Address
{
private set { address = value; }
get { return address; }
}
public bool CanMove
{
set { canMove = value; }
get { return value; }
}
public bool MoveToNewAddress(Address newAddress)
{
if (!CanMove) return false;
address = newAddress;
return true;
}
}
[TestFixture]
public class PersonTests
{
private Person toTest;
private readonly static Name NAME = new Name { First = "Charlie", Last = "Brown" };
private readonly static Address ADDRESS =
new Address {
Line1 = "1600 Pennsylvania Ave NW",
City = "Washington",
State = "DC",
ZipCode = "20500" };
[SetUp]
public void SetUp()
{
toTest = new Person;
}
[Test]
public void NameDefaultsToEmpty()
{
Assert.AreEqual(Name.Empty, toTest.Name);
}
[Test]
public void CanMoveDefaultsToTrue()
{
Assert.AreEqual(true, toTest.CanMove);
}
[Test]
public void AddressDefaultsToEmpty()
{
Assert.AreEqual(Address.Empty, toTest.Address);
}
[Test]
public void NameIsSet()
{
toTest.Name = NAME;
Assert.AreEqual(NAME, toTest.Name);
}
[Test]
public void CanMoveIsSet()
{
toTest.CanMove = false;
Assert.AreEqual(false, toTest.CanMove);
}
[Test]
public void AddressIsChanged()
{
Assert.IsTrue(toTest.MoveToNewAddress(ADDRESS));
Assert.AreEqual(ADDRESS, toTest.Address);
}
[Test]
public void AddressIsNotChanged()
{
toTest.CanMove = false;
Assert.IsFalse(toTest.MoveToNewAddress(ADDRESS));
Assert.AreNotEqual(ADDRESS, toTest.Address);
}
}
In order to make the test fail first, stub the methods or properties, but do not implement any behavior. Run the tests, watch them fail, then add in behavior one line at a time until it passes. Once it passes, stop. Do not write any more code unless you write more tests (unless you're refactoring, in which case you do not add behavior).