diff --git a/WebSite/.idea/workspace.xml b/WebSite/.idea/workspace.xml index c45644f9..92302460 100644 --- a/WebSite/.idea/workspace.xml +++ b/WebSite/.idea/workspace.xml @@ -4,7 +4,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -40,6 +40,15 @@ + + + + + + + + + @@ -70,39 +79,43 @@ - + - - + + - + - - - - + + + + + + - - - - + + + + + + - - + + - + @@ -124,6 +137,8 @@ @@ -160,6 +175,7 @@ + @@ -206,9 +222,22 @@ + + + + + + + + - @@ -268,6 +297,7 @@ + @@ -278,7 +308,6 @@ - @@ -345,11 +374,9 @@ - - - - - + + + @@ -357,16 +384,9 @@ - - - - - - - - + - + @@ -381,68 +401,79 @@ - + - + - - - + + + + + - - - + + + + + - + - + - + - + - + - + - + + + + + + + + - + - + - + - + diff --git a/WebSite/css/bootstrap.css b/WebSite/css/bootstrap.css index b725064a..39400364 100644 --- a/WebSite/css/bootstrap.css +++ b/WebSite/css/bootstrap.css @@ -974,7 +974,7 @@ pre { padding: 0 3px 2px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; - color: #333333; + color: #d14; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; diff --git a/WebSite/css/csharp.css b/WebSite/css/csharp.css new file mode 100644 index 00000000..afa8c9f6 --- /dev/null +++ b/WebSite/css/csharp.css @@ -0,0 +1,36 @@ +.csharpcode, .csharpcode pre +{ + font-size: small; + color: black; + font-family: Consolas, "Courier New", Courier, Monospace; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; + /*white-space: pre;*/ +} + +.csharpcode pre { margin: 0em; } + +.csharpcode .rem { color: #008000; } + +.csharpcode .kwrd { color: #0000ff; } + +.csharpcode .str { color: #a31515; } + +.csharpcode .op { color: #0000c0; } + +.csharpcode .preproc { color: #cc6633; } + +.csharpcode .asp { background-color: #ffff00; } + +.csharpcode .html { color: #800000; } + +.csharpcode .attr { color: #ff0000; } + +.csharpcode .alt +{ + background-color: #f4f4f4; + width: 100%; + margin: 0em; +} + +.csharpcode .lnum { color: #606060; } diff --git a/WebSite/img/ErrorSample1.png b/WebSite/img/ErrorSample1.png index 1b89cd81..395fff4d 100644 Binary files a/WebSite/img/ErrorSample1.png and b/WebSite/img/ErrorSample1.png differ diff --git a/WebSite/img/ErrorSample2.png b/WebSite/img/ErrorSample2.png index 4aa8835b..d1f3ff18 100644 Binary files a/WebSite/img/ErrorSample2.png and b/WebSite/img/ErrorSample2.png differ diff --git a/WebSite/img/ErrorSample3.png b/WebSite/img/ErrorSample3.png index 15905c9b..f4a0d936 100644 Binary files a/WebSite/img/ErrorSample3.png and b/WebSite/img/ErrorSample3.png differ diff --git a/WebSite/index.html b/WebSite/index.html index 7aba6741..695668ec 100644 --- a/WebSite/index.html +++ b/WebSite/index.html @@ -12,6 +12,7 @@ + +
+var integers = new int[] { 1, 2, 3, 4, 5, 666 };
+Check.That(integers).Contains(3, 5, 666);
+
+integers = new int[] { 1, 2, 3 };
+Check.That(integers).IsOnlyMadeOf(3, 2, 1);
+
+var guitarHeroes = new[] { "Hendrix", "Paco de Lucia", "Django Reinhardt", "Baden Powell" };
+Check.That(guitarHeroes).ContainsExactly("Hendrix", "Paco de Lucia", "Django Reinhardt", "Baden Powell");
+
+var camus = new Person() { Name = "Camus" };
+var sartre = new Person() { Name = "Sartre" };
+Check.That(camus).IsNotEqualTo(sartre).And.IsInstanceOf<Person>();
+
+var heroes = "Batman and Robin";
+Check.That(heroes).Not.Contains("Joker").And.StartsWith("Bat").And.Contains("Robin");
+
+int? one = 1;
+Check.That(one).HasAValue().Which.IsPositive().And.IsEqualTo(1);
+
+const Nationality FrenchNationality = Nationality.French;
+Check.ThatEnum(FrenchNationality).IsNotEqualTo(Nationality.Korean);
+
+string motivationalSaying = "Failure is mother of success.";
+Check.That(motivationalSaying).IsNotInstanceOf<int>();
+        
+ With NFluent, you can also write checks like this: + +
+var persons = new List<Person>
+                     {
+                         new Person { Name = "Thomas", Age = 38 },
+                         new Person { Name = "Achille", Age = 10, Nationality = Nationality.French },
+                         new Person { Name = "Anton", Age = 7, Nationality = Nationality.French },
+                         new Person { Name = "Arjun", Age = 7, Nationality = Nationality.Indian }
+                     };
+
+Check.That(persons.Properties("Name")).ContainsExactly("Thomas", "Achille", "Anton", "Arjun");
+Check.That(persons.Properties("Age")).ContainsExactly(38, 10, 7, 7);
+Check.That(persons.Properties("Nationality")).ContainsExactly(Nationality.Unknown, Nationality.French, Nationality.French, Nationality.Indian);
+
+// more fluent than the following classical NUnit way, isn't it? 
+// CollectionAssert.AreEquivalent(persons.Properties("Age"), new[] { 38, 10, 7, 7 });
+
+// it's maybe even more fluent than the java versions
+
+// FEST fluent assert v 2.x:
+// assertThat(extractProperty("name" , String.class).from(inn.getItems())).containsExactly("+5 Dexterity Vest", "Aged Brie", "Elixir of the Mongoose", "Sulfuras, Hand of Ragnaros", "Backstage passes to a TAFKAL80ETC concert", "Conjured Mana Cake");
+
+// FEST fluent assert v 1.x:
+// assertThat(inn.getItems()).onProperty("name").containsExactly("+5 Dexterity Vest", "Aged Brie", "Elixir of the Mongoose", "Sulfuras, Hand of Ragnaros", "Backstage passes to a TAFKAL80ETC concert", "Conjured Mana Cake");
+        
+ Or like this: + +
+// Works also with lambda for exception checking
+Check.That(() => { throw new InvalidOperationException(); }).Throws<InvalidOperationException>();
+
+// or execution duration checking
+Check.That(() => Thread.Sleep(30)).LastsLessThan(60, TimeUnit.Milliseconds);
+        

NFluent is also extensible to your specific needs


@@ -249,20 +313,34 @@

We aim to release the most fluent .NET assertion lib ever ;-)

Indeed:
  • we think that writing a lambda expression within an check statement is not really a fluent experience (neither on a reading perspective).
  • -
  • we think that those other check libraries have not chosen the proper vocabulary (.Should().... why don't they choose Must instead?!?). And thus, you'd rather rely on a stronger semantic for your checks (i.e. NFluent's Check.That).
  • +
  • we think that those other check libraries have not chosen the proper vocabulary (.Should().... why don't they choose Must instead?!?). And thus, you'd rather rely on a stronger semantic for your checks (i.e. NFluent's Check.That).


Is the next statement fluent to write for you?!?
- new[] { 1, 2, 3 }.Should().Contain(item => item > 3, "at least {0} item should be larger than 3", 1); + +
+var myArray = new[] { 1, 2, 3 };
+
+myArray.Should().Contain(item => item > 3, "at least {0} item should be larger than 3", 1);
+
+ We don't think so, and we prefer the NFluent version: + +
+Check.That(myArray).IsGreaterThan(3);
+

+ Other example: are you happy to type new[] {...} as a method argument like does another famous "fluent" library?
- Are you happy to type new[] {...} as a method argument like this?!?
- - ints.Should().Have.SameSequenceAs(new[] { 1, 2, 3 }); - + +
+myArray.Should().Have.SameSequenceAs(new[] { 1, 2, 3 });

+ or like us, you prefer to type: + +
+Check.That(myArray).ContainsExactly(1,2,3);

NFluent is different

    @@ -302,6 +380,7 @@

    Wall of fame

  • To Rui CARVALHO, for the nice NFluent logo he has designed.
  • To the mates that gave me ideas and feedbacks to make this lib as fluent as possible: Joel COSTIGLIOLA (former active contributor of Java FEST Assert, which now works on his AssertJ fork), Benoit LABAERE ...
  • To Omer RAVIV, which supports the NFluent project by offering us some free licenses for the nice OzCode debugging extension for Visual Studio.
  • +
  • To the awesome and truly addictive NCrunch, that really helps me in my day-to-day TDD.
  • To Jetbrains, which still creates some of the coolest tools for developers (whatever the language), and which supports our NFluent project by providing us some space within their teamcity code better instance (note: you can enter as guest).

@@ -330,6 +409,18 @@

Wall of fame

< Back to the top


+
+
+

+
+

Wanna go to the next level with us?

+ You should follow what's gonna be delivered soon by the NFluent team... Cause based on Rui's reflexions, we decided to develop a NFluent plugin (whether a Visual Studio or R#). +

This plugin should definitely revolutionize the way we TDD!

+

+
+

< Back to the top

+
+