alkampfer on December 7th, 2007

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

kick it on DotNetKicks.com

Continue reading about More fluent on Nunit

alkampfer on December 7th, 2007

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 [...]

kick it on DotNetKicks.com

Continue reading about Comparing Entities

alkampfer on December 4th, 2007

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 [...]

kick it on DotNetKicks.com

Continue reading about DropDownList And ViewState = false