Example #1
0
 public void BranchesTest()
 {
     BranchReactance target = new BranchReactance(); // TODO: Initialize to an appropriate value
     EntityCollection<Branch> expected = null; // TODO: Initialize to an appropriate value
     EntityCollection<Branch> actual;
     target.Branches = expected;
     actual = target.Branches;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #2
0
 public void CurrentBranchReactanceTest()
 {
     BranchReactance target = new BranchReactance(); // TODO: Initialize to an appropriate value
     double expected = 0F; // TODO: Initialize to an appropriate value
     double actual;
     target.CurrentBranchReactance = expected;
     actual = target.CurrentBranchReactance;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Example #3
0
 public void BranchReactanceConstructorTest()
 {
     BranchReactance target = new BranchReactance();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Example #4
0
 public void IdTest()
 {
     BranchReactance target = new BranchReactance(); // 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.");
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the BranchReactances EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBranchReactances(BranchReactance branchReactance)
 {
     base.AddObject("BranchReactances", branchReactance);
 }
 /// <summary>
 /// Create a new BranchReactance object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="initialBranchReactance">Initial value of the InitialBranchReactance property.</param>
 /// <param name="currentBranchReactance">Initial value of the CurrentBranchReactance property.</param>
 /// <param name="minimalBranchReactance">Initial value of the MinimalBranchReactance property.</param>
 /// <param name="maximalBranchReactance">Initial value of the MaximalBranchReactance property.</param>
 public static BranchReactance CreateBranchReactance(global::System.Int32 id, global::System.Double initialBranchReactance, global::System.Double currentBranchReactance, global::System.Double minimalBranchReactance, global::System.Double maximalBranchReactance)
 {
     BranchReactance branchReactance = new BranchReactance();
     branchReactance.Id = id;
     branchReactance.InitialBranchReactance = initialBranchReactance;
     branchReactance.CurrentBranchReactance = currentBranchReactance;
     branchReactance.MinimalBranchReactance = minimalBranchReactance;
     branchReactance.MaximalBranchReactance = maximalBranchReactance;
     return branchReactance;
 }
        /// <summary>
        /// Insert specified branch reactance in database
        /// </summary>
        /// <param name="dto">dto data for branch reactance</param>
        public void InsertBranchReactance(BranchReactanceDto 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.BranchReactances);
                BranchReactance brRtc = new BranchReactance();

                brRtc.Id = dto.Id;
                brRtc.InitialBranchReactance = dto.InitialBranchReactance;
                brRtc.CurrentBranchReactance = dto.CurrentBranchReactance;
                brRtc.MinimalBranchReactance = dto.MinimalBranchReactance;
                brRtc.MaximalBranchReactance = dto.MaximalBranchReactance;

                //Adds new branch reactance details to context
                dbContext.BranchReactances.AddObject(brRtc);

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