Example #1
0
 public IEnumerable<DDefined_Instruction> Defined_Instruction_Create(
     DDefined_Instruction creating)
 {
     IDataRepository<DDefined_Instruction> definedInstructions =
         RepositoryFactory.Instance.Construct<DDefined_Instruction>();
     definedInstructions.Create(creating);
     return definedInstructions;
 }
        public void DDefined_Instruction_WhenAskedForKey_ReturnsEmail_ID()
        {
            //Arrange: An avatar with a unique key is constructed.
            DDefined_Instruction avatar = new DDefined_Instruction { Defined_Instruction_ID = -1 };

            //Act: the key is retrieved.
            int key = avatar.key;

            //Assert: the key is the same as the friended user's ID.
            Assert.AreEqual(key, avatar.Defined_Instruction_ID);
        }
        public void DDefined_InstructionWithSqlMembers_WhenScrubbed_BecomesSafe()
        {
            //Arrange: An avatar with malicious html and sql members is constructed.
            string malicious = "1');DELETE TABLE dbo.example;--";
            DDefined_Instruction avatar = new DDefined_Instruction{
                Description = malicious
            };

            //Act: The friended user is scrubbed.
            avatar.Scrub();

            //Assert: The friended user has no html in its members.
            Assert.AreNotEqual(malicious, avatar.Description);
        }
        public void DDefined_InstructionWithHtmlMembers_WhenScrubbed_BecomesSafe()
        {
            //Arrange: An avatar with malicious sql members is constructed.
            string malicious = "<div></div>";
            DDefined_Instruction avatar = new DDefined_Instruction{
                Description = malicious
            };

            //Act: The friended user is scrubbed.
            avatar.Scrub();

            //Assert: The friended user has no html in its members.
            Assert.AreNotEqual(malicious, avatar.Description);
        }
Example #5
0
 public ActionResult DefinedInstruction_Update(DDefined_Instruction updating)
 {
     return View("Index");
 }
Example #6
0
 public ActionResult DefinedInstruction_Delete(DDefined_Instruction deleting)
 {
     return View("Index");
 }