In the previous post I talked about nunit and fluent interface, I did some modification, now I can write
[Test]public void TestSimpleEqualsConditionedProperty3() { SimpleThreeProps obja = new SimpleThreeProps(“test”, 15, “EQ”); SimpleThreeProps objb = new SimpleThreeProps(“test”, 1, “EQ”); Assert.That(obja, MyIs.SomePropertiesEqualTo(objb, “PropA”, “ThirdProperty”) .And.Property(“PropB”).GreaterThan(14));}
Now I can check for equality with a list of properties but added support to create constraint over the single property using the basic property constraint of nunit.
Alk
This morning a friend of mine post about testing for equality of two class. My opinion is that to test if we have the need to test if two entities has all or some property equals it is better not to override equals or modify the original entity. I’m collecting a series of helpers class [...]
It is a while that I do not write in my English blog, today I want to continue a issue discussed in an old post. Consider this code
<body> <form id=”form1″ runat=”server” oninit=”Page_Init”> <div> <asp:DropDownList ID=”ddlist1″ EnableViewState=”false” AutoPostBack=”true” AppendDataBoundItems=”true” runat=”server” OnSelectedIndexChanged=”SelectedIndexChanged”> <asp:ListItem>Select a team</asp:ListItem> </asp:DropDownList> <asp:DropDownList ID=”ddlist2″ EnableViewState=”false” AutoPostBack=”true” AppendDataBoundItems=”true” runat=”server” OnSelectedIndexChanged=”SelectedIndexChanged”> <asp:ListItem>Select a team</asp:ListItem> </asp:DropDownList> </div> </form></body></html><script runat=”server”> protected void Page_Init(object sender, EventArgs e) { ddlist1.DataSource = new string[] { “Ferrari”, “McLaren”, “Renault” }; ddlist2.DataSource = new string[] { “Ferrari”, “McLaren”, “Renault” }; DataBind(); } protected void SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl = (DropDownList) sender; Response.Write(String.Format(“SelectedIndexChanged {0} value = {1}<BR/>”, ddl.ID, ddl.SelectedValue)); } </script>This code contains two simple DropDownList, both with ViewState disabled, the datasource is rebound at each PageInit and in SelectedIndexChanged we simple write a string in response output. [...]
If you adopt a MVC pattern for your code in windows forms, each form should implements some Interface to make possible for the controller to communicate with the UI. This is needed so the Controller does not work directly with the form but instead with an interface such as IShippingUi. But what happens when the [...]
Continue reading about Model View Controller and Cross Thread Ui methods invoke
Today I was reading some posts (Simone, Ayende, Alessandro and others). I want now to express my opinion, I’m using my English blog, even if English is not my first language because I like to make it readable by all people, and I hope that I can be clear enough, please everyone to excuse my [...]




