void Test_Get_Current_Project_Returns_Null_When_No_Cookie_Set() { HttpCookieCollection cookies = new HttpCookieCollection(); ProjectsHelper helper = new ProjectsHelper(); int? id = helper.GetCurrentProjectId(cookies); Assert.Null(id); }
void Test_Get_Current_Project() { HttpCookieCollection cookies = new HttpCookieCollection { new HttpCookie("CurrentProjectId", "2"), new HttpCookie("CurrentProjectName", "ProjectName") }; ProjectsHelper helper = new ProjectsHelper(); int? id = helper.GetCurrentProjectId(cookies); Assert.NotNull(id); Assert.Equal(2, id); }
void Test_Get_Current_Project_Throws_Exception_When_Parameter_Null() { ProjectsHelper helper = new ProjectsHelper(); Assert.Throws<ArgumentNullException>(() => helper.GetCurrentProjectId(null)); }