Example #1
0
 public void IdTest()
 {
     Voltage target = new Voltage(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     target.Id = expected;
     actual = target.Id;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #2
0
 public void CurrentVoltageTest()
 {
     Voltage target = new Voltage(); // TODO: Initialize to an appropriate value
     double expected = 0F; // TODO: Initialize to an appropriate value
     double actual;
     target.CurrentVoltage = expected;
     actual = target.CurrentVoltage;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Voltages EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToVoltages(Voltage voltage)
 {
     base.AddObject("Voltages", voltage);
 }
 /// <summary>
 /// Create a new Voltage object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="initialVoltage">Initial value of the InitialVoltage property.</param>
 /// <param name="currentVoltage">Initial value of the CurrentVoltage property.</param>
 /// <param name="minimalVoltage">Initial value of the MinimalVoltage property.</param>
 /// <param name="maximalVoltage">Initial value of the MaximalVoltage property.</param>
 public static Voltage CreateVoltage(global::System.Int32 id, global::System.Double initialVoltage, global::System.Double currentVoltage, global::System.Double minimalVoltage, global::System.Double maximalVoltage)
 {
     Voltage voltage = new Voltage();
     voltage.Id = id;
     voltage.InitialVoltage = initialVoltage;
     voltage.CurrentVoltage = currentVoltage;
     voltage.MinimalVoltage = minimalVoltage;
     voltage.MaximalVoltage = maximalVoltage;
     return voltage;
 }
Example #5
0
 public void VoltageConstructorTest()
 {
     Voltage target = new Voltage();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Example #6
0
 public void NodesTest()
 {
     Voltage target = new Voltage(); // TODO: Initialize to an appropriate value
     EntityCollection<Node> expected = null; // TODO: Initialize to an appropriate value
     EntityCollection<Node> actual;
     target.Nodes = expected;
     actual = target.Nodes;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
        /// <summary>
        /// Insert specified NodeVoltage in database
        /// </summary>
        /// <param name="dto">dto data for NodeVoltage</param>
        public void InsertNodeVoltage(NodeVoltageDto dto)
        {
            try
            {
                //Before any action, it must be updated because calls from contract uses
                //only one instance of UserManager.
                dbContext.Refresh(System.Data.Objects.RefreshMode.StoreWins, dbContext.Voltages);
                Voltage nv = new Voltage();

                nv.Id = dto.Id;
                nv.InitialVoltage = dto.InitialNodeVoltage;
                nv.CurrentVoltage = dto.CurrentNodeVoltage;
                nv.MinimalVoltage = dto.MinimalNodeVoltage;
                nv.MaximalVoltage = dto.MaximalNodeVoltage;

                //Adds new NodeVoltage details to context
                dbContext.Voltages.AddObject(nv);

                //saves changes.
                dbContext.SaveChanges();
            }
            catch (Exception exception)
            {
                throw new Exception("SmartGridDataMenagers: " + exception.Message);
            }
        }