Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        void Test_Get_Current_Project_Throws_Exception_When_Parameter_Null()
        {
            ProjectsHelper helper = new ProjectsHelper();

            Assert.Throws<ArgumentNullException>(() => helper.GetCurrentProjectId(null));
        }