Archive for September 2009


Nice UX on The Book Depository’s Payment Page

September 25th, 2009 — 10:07am

Quite often, when buying books off Amazon, you can sometimes get them cheaper by going to a marketplace seller’s own website. That’s how I came across The Book Depository, where I have bought a few books recently.

One nice UX feature that I like on this site was the way in which they highlight where to find your credit card CVV/security number depending on which credit card you are using:

Visa card with CVV number highlighted

Visa card with CVV number highlighted

The image above shows the security number highlighted on the signature strip when you select Visa from the credit card type drop-down list. Compare that with the screenshot below showing the security number highlighted on the front of the card when American Express is selected:

AMEX card with the CVV number highlighted

AMEX card with the CVV number highlighted

It’s a simple feature really, but nicely implemented.

Comment » | ux

Recommended Reading for 2009-09-21

September 21st, 2009 — 1:11pm

Comment » | links

How To Reset Your SubSonic 3 ActiveRecord Test Repository For Each Unit Test

September 4th, 2009 — 2:09pm

When writing unit tests with SubSonic’s new built-in testing for ActiveRecord don’t forget that each time you call the Setup() method on your ActiveRecord object it adds records to any that have already been created. For example:

[Test]
public void Foo_Bar() {
    Foo.Setup(10);
    Assert.AreEqual(10, Foo.All().Count());
}

[Test]
public void Bar_Foo() {
    Foo.Setup(10);

    // This will fail: Foo.All().Count() will return 20
    Assert.AreEqual(10, Foo.All().Count());
}

To reset your test repositories you will need to call the ResetTestRepo() method prior to each test, which can be accomplished easily enough by adding the method call to your test’s [SetUp] method:

[SetUp]
public void SetUp() {
    Foo.ResetTestRepo();
}

[Test]
public void Foo_Bar() {
    Foo.Setup(10);
    Assert.AreEqual(10, Foo.All().Count());
}

[Test]
public void Bar_Foo() {
    Foo.Setup(10);

    // Now Foo.All().Count() will return 10 and the test will pass
    Assert.AreEqual(10, Foo.All().Count());
}

Hopefully this will save you a bit of time, as well as head scratching :p

Comment » | asp.net, c#

Recommended Reading for 2009-09-04

September 4th, 2009 — 10:00am

Comment » | links

Back to top