Beispiel #1
0
        public void TestCurrentCalculateMethod()
        {
            Voltage    voltage    = Voltage.make(5);
            Resistance resistance = Resistance.make(100);

            Current current = OhmsLaw.calculate(voltage, resistance);

            Assert.AreEqual(0.05F, current.Value);
        }
Beispiel #2
0
        public void TestVoltageCalculateMethod()
        {
            Current    current    = Current.make(2);
            Resistance resistance = Resistance.make(1000);

            Voltage voltage = OhmsLaw.calculate(current, resistance);

            Assert.AreEqual(2000, voltage.Value);
        }
 public static Resistance calculate(Voltage voltage, Current current)
 {
     return(Resistance.make(voltage.Value / current.Value));
 }
Beispiel #4
0
        public void TestMakeMethod()
        {
            Resistance resistance = Resistance.make(400);

            Assert.AreEqual("400Ω", resistance.ToString());
        }