[tinybdd] r80 committed - Edited wiki page through web user interface.

0 views
Skip to first unread message

codesite...@google.com

unread,
Nov 4, 2009, 5:10:35 AM11/4/09
to tin...@googlegroups.com
Revision: 80
Author: goeran.hansen
Date: Wed Nov 4 02:10:20 2009
Log: Edited wiki page through web user interface.
http://code.google.com/p/tinybdd/source/detail?r=80

Modified:
/wiki/UseTinyBDDWithNUnit.wiki

=======================================
--- /wiki/UseTinyBDDWithNUnit.wiki Wed Nov 4 01:56:25 2009
+++ /wiki/UseTinyBDDWithNUnit.wiki Wed Nov 4 02:10:20 2009
@@ -13,4 +13,47 @@
If you want to use it together with NUnit it’s fine. All you need to do is
to reference the TinyBDD.dll and the TinyBDD.Specification.NUnit.dll. If
you for instance are using NUnit 2.5.0 you have to reference the
TinyBDD.Specification.NUnit.2.5.0.dll.

= 2. Use NUnit attributes =
-Because you find yourself in a NUnit environment you still have to use the
NUnit attributes in order to run your tests inside the NUnit Test Runner.
+Because you find yourself in a NUnit environment you still have to use the
NUnit attributes in order to run your tests inside the NUnit Test Runner.
+
+{{{
+ [TestFixture]
+ public class When_Username_is_entered
+ {
+ [Test]
+ public void Assure_LoginCommand_is_enabled()
+ {
+ }
+ }
+}}}
+
+= 3. Add BDD goodness to your tests =
+Use TinyBDD to add BDD (Behavior Driven Development) goodness to your
tests. Also notice how well structured your tests ends up to be, and not to
mention how readable they have become.
+
+{{{
+ [TestFixture]
+ public class When_Username_is_entered : Shared
+ {
+ [SetUp]
+ public void Setup()
+ {
+ Given(dependencies_are_created()).And(ViewModel_is_created);
+
+ When("Username is entered", () =>
+ viewModel.Username.Value = "goeran");
+ }
+
+ [Test]
+ public void Assure_LoginCommand_is_enabled()
+ {
+ Then("assure LoginCommand is enabled", () =>
+ viewModel.Login.CanExecute(null).ShouldBeTrue());
+ }
+ }
+
+}}}
+
+Clean Code is readable code. If you want to have a maintainable test suit
you also need to have Clean Code inside your tests. Remember what Ward
Cunningham said about Clean Code:
+
+“You know you are working on clean code when each routine you read turns
out to be pretty much what you expected. *You can call it beautiful code
when the code also makes it look like the language was made for the
problem*”.
+
+TinyBDD can help you structuring your test code so I look like the
language you are using was made for the problem (unit testing).
Reply all
Reply to author
Forward
0 new messages