private string GetVoltageKey(Voltage voltage) { if (voltage.Equals(Voltage.V1)) { return("1"); } else if (voltage.Equals(Voltage.V8)) { return("2"); } else if (voltage.Equals(Voltage.V40)) { return("3"); } else if (voltage.Equals(Voltage.V100)) { return("4"); } else if (voltage.Equals(Voltage.V10)) { return("5"); } else if (voltage.Equals(Voltage.V80)) { return("6"); } else if (voltage.Equals(Voltage.V250)) { return("7"); } else { throw new ArgumentException("Invalid voltage enum"); } }
public void EqualsObjectTest() { Voltage target = new Voltage(10F); object obj = new Voltage(10F); bool expected = true; bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }
public void EqualsDoubleTest() { Voltage target = new Voltage(10F); double obj = 10F; bool expected = true; bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }
/// <inheritdoc/> public bool Equals(RandomAccessMemoryEntity other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(MemoryType == other.MemoryType && Frequency == other.Frequency && CASLatency == other.CASLatency && Timings == other.Timings && Voltage.Equals(other.Voltage) && XMP == other.XMP && ECC == other.ECC && PCIndex == other.PCIndex && Volume == other.Volume); }