Unit Testing-Method-ASP.NET-Help?
<p>Hi I have a simple method, where It takes a string as parameter <strong>(domainname//firstname.lastname)</strong> and takes out (<strong>domainname//</strong>) and returns string as just firstname.lastname.</p>

<p>I need to unit test for the following case.</p>

<ol>
<li>check for single slash (domainname/firstname.lastname)</li>
<li>Check for empty string</li>
<li>Check for null value</li>
<li>Check wheather the string contains // or not</li>
</ol>

<p>I wrote the following but it does not make any sense to me, coz this is completely wrong.</p>

<pre><code>#region Checking for null value
    [TestMethod]
    public void CheckForNullValueTest()
    {
        string expected = "";
        string source = @"domainname//hari.gillala";
        string actual = Function.RemoveSlash(source);
        assert.Equal(expected, actual);
    }
    #endregion

    #region Checking for empty
    [TestMethod]
    public void CheckForEmptyValueTest()
    {
        string expected = string.empty;
        string source = @"domainname//hari.gillala";
        string actual = Function.RemoveSlash(source);
        assert.Equal(expected, actual);
    }
    #endregion

    #region Checking for singleslash
    [TestMethod]
    public void CheckForEmptyValueTest()
    {
        string expected = @"domainname/hari.gillala";
        string source = "domainname//hari.gillala";
        string actual = Function.RemoveSlash(source);
        assert.Equal(expected, actual);
    }
    #endregion


    #region Checking for Doubleslash
    [TestMethod]
    public void CheckForEmptyValueTest()
    {
        string expected = @"domainname//hari.gillala";
        string source = "domainname//hari.gillala";
        string actual = Function.RemoveSlash(source);
        assert.Equal(expected, actual);
    }
    #endregion
</code></pre>

<p>I know I am completely wrong, but some can help me to understand, how to write, what are the mistakes. thanks for the patience</p>

<p>Many Thanks
Hari</p>
