예제 #1
0
        public void rptSubjectListOnItemCommand(object source, RepeaterCommandEventArgs e)
        {
            ViewState["SortExpression"] = e.CommandName;
            FillRepeater();

            if (e.CommandName == "Edit")
            {
                Response.Redirect(EditUrl(string.Empty, string.Empty, "Edit", "classid=" + e.CommandArgument));
            }

            if (e.CommandName == "Delete")
            {
                var tc = new ClassController();
                tc.DeleteClass(Convert.ToInt32(e.CommandArgument));
            }
            //Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
        }
        public async void Delete_Deletes_Existing_AndReturnsDeleted()
        {
            // Arrange
            var toRemove = new Class()
            {
                ID = "1", color = "green", icon = "important", name = "iet", userID = "0"
            };

            // Act
            var result = await controller.DeleteClass(toRemove.ID);

            // Assert
            result.Value.Should().BeEquivalentTo(toRemove);
        }