public void GetHashCode_should_return_the_same_value_as_another_instance_with_the_same_value() { var value1 = new PII("Test Value"); var value2 = new PII("Test Value"); value1.GetHashCode().Should().Be(value2.GetHashCode()); }
public void GetHashCode_should_return_a_different_value_when_passed_another_instance_with_a_different_value() { var value1 = new PII("Test Value"); var value2 = new PII("Test Value"); value1.GetHashCode().Should().Be(value2.GetHashCode()); }
public void Equals_should_return_false_when_passed_another_instance_with_a_different_value() { var value1 = new PII("Test Value"); var value2 = new PII("Different Value"); value1.Equals(value2).Should().BeFalse(); }
static void Main(string[] args) { PII pObj = new PII(); pObj.KeyValuePairExample(); Console.ReadLine(); }
public void Equals_should_return_true_when_passed_another_instance_with_the_same_value() { var value1 = new PII("Test Value"); var value2 = new PII("Test Value"); value1.Equals(value2).Should().BeTrue(); }
public void ToString_should_return_the_redacted_message_when_used_in_a_logger() { var logger = new TestLogger <PIITests>(outputHelper); var valueObject = new PII(testValue); logger.LogInformation($"PII: {valueObject}"); logger.Messages[0].Should().Be("PII: [Redacted]"); }
static void Main(string[] args) { var key = PII.GenerateKey(); var person = MakePerson(); PrintPerson(person, "A PERSON MODEL", ConsoleColor.Red); person.Encrypt(key); PrintPerson(person, "ENCRYPTED PERSON", ConsoleColor.Green); person.Decrypt(key); PrintPerson(person, "DECRYPTED PERSON", ConsoleColor.Red); }
protected void GridResult_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[3].Text == "PartI") { if (e.Row.Cells[5].Text == "Pass") { PI += 1; } e.Row.BackColor = System.Drawing.Color.AntiqueWhite; } else if (e.Row.Cells[3].Text == "PartII") { if (e.Row.Cells[5].Text == "Pass") { PII += 1; } e.Row.BackColor = System.Drawing.Color.Aquamarine; } else if (e.Row.Cells[3].Text == "SectionA") { if (e.Row.Cells[5].Text == "Pass") { SA += 1; } e.Row.BackColor = System.Drawing.Color.AliceBlue; } else if (e.Row.Cells[3].Text == "SectionB") { if (e.Row.Cells[5].Text == "Pass") { SB += 1; } e.Row.BackColor = System.Drawing.Color.LightCoral; } } lblPartICount.Text = PI.ToString(); lblPartIICount.Text = PII.ToString(); lblSectionACount.Text = SA.ToString(); lblSectionBCount.Text = SB.ToString(); }
public void Equals_should_return_false_when_passed_null() { var value1 = new PII(testValue); value1.Equals(null).Should().BeFalse(); }
public void ToString_should_return_the_redacted_message() { var valueObject = new PII(testValue); valueObject.ToString().Should().Be("[Redacted]"); }
public void SensitiveValue_should_return_the_sensitive_value() { var valueObject = new PII(testValue); valueObject.SensitiveValue.Should().Be(testValue); }