예제 #1
0
 public void BranchReactanceIdTest()
 {
     Branch target = new Branch(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     target.BranchReactanceId = expected;
     actual = target.BranchReactanceId;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
예제 #2
0
 public void BranchNameTest()
 {
     Branch target = new Branch(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.BranchName = expected;
     actual = target.BranchName;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Branches EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBranches(Branch branch)
 {
     base.AddObject("Branches", branch);
 }
 /// <summary>
 /// Create a new Branch object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="branchName">Initial value of the BranchName property.</param>
 /// <param name="branchResistanceId">Initial value of the BranchResistanceId property.</param>
 /// <param name="branchReactanceId">Initial value of the BranchReactanceId property.</param>
 /// <param name="nodeId">Initial value of the NodeId property.</param>
 /// <param name="nodeParent">Initial value of the NodeParent property.</param>
 public static Branch CreateBranch(global::System.Int32 id, global::System.String branchName, global::System.Int32 branchResistanceId, global::System.Int32 branchReactanceId, global::System.Int32 nodeId, global::System.Int32 nodeParent)
 {
     Branch branch = new Branch();
     branch.Id = id;
     branch.BranchName = branchName;
     branch.BranchResistanceId = branchResistanceId;
     branch.BranchReactanceId = branchReactanceId;
     branch.NodeId = nodeId;
     branch.NodeParent = nodeParent;
     return branch;
 }
예제 #5
0
 public void BranchReactanceReferenceTest()
 {
     Branch target = new Branch(); // TODO: Initialize to an appropriate value
     EntityReference<BranchReactance> expected = null; // TODO: Initialize to an appropriate value
     EntityReference<BranchReactance> actual;
     target.BranchReactanceReference = expected;
     actual = target.BranchReactanceReference;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
예제 #6
0
 public void BranchConstructorTest()
 {
     Branch target = new Branch();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
예제 #7
0
 public void NodeTest()
 {
     Branch target = new Branch(); // TODO: Initialize to an appropriate value
     Node expected = null; // TODO: Initialize to an appropriate value
     Node actual;
     target.Node = expected;
     actual = target.Node;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
예제 #8
0
        /// <summary>
        /// Insert specified branch in database
        /// </summary>
        /// <param name="dto">dto data for branch</param>
        public void InsertBranch(BranchDto 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.Branches);
                Branch brch = new Branch();

                brch.Id = dto.Id;
                brch.BranchName = dto.BranchName;
                brch.BranchResistanceId = dto.BranchResistanceId;
                brch.BranchReactanceId = dto.BranchReactanceId;
                brch.NodeId = dto.NodeId;

                //Adds new branch details to context
                dbContext.Branches.AddObject(brch);

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