예제 #1
0
 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");
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #5
0
파일: VoltageTest.cs 프로젝트: avs009/gsf
 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);
 }
예제 #6
0
파일: VoltageTest.cs 프로젝트: avs009/gsf
 public void EqualsDoubleTest()
 {
     Voltage target = new Voltage(10F);
     double obj = 10F;
     bool expected = true;
     bool actual;
     actual = target.Equals(obj);
     Assert.AreEqual(expected, actual);
 }