Esempio n. 1
0
 public void StateDtoConstructorTest()
 {
     int id = 0; // TODO: Initialize to an appropriate value
     string name = string.Empty; // TODO: Initialize to an appropriate value
     StateDto target = new StateDto(id, name);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Esempio n. 2
0
        /// <summary>
        /// Returns list of all states from database.
        /// </summary>
        /// <returns>List list of StateDto's</returns>
        public List<StateDto> GetAllStates()
        {
            //Instantiate list of dto states which has been returned.
            List<StateDto> listDto = new List<StateDto>();
            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.States);

                //list of states from entities
                List<State> list = dbContext.States.OrderBy(st => st.Id).ToList();

                //filling the list
                foreach (State st in list)
                {
                    StateDto stateDto = new StateDto(st.Id, st.Name);
                    listDto.Add(stateDto);
                }
            }
            catch (Exception exception)
            {
                throw new Exception("SmartGridDataMenagers: " + exception.Message);
            }
            //returns list of all states as list of dtoes.
            return listDto;
        }
Esempio n. 3
0
 public void NameTest()
 {
     StateDto target = new StateDto(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.Name = expected;
     actual = target.Name;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Esempio n. 4
0
 public void IdTest()
 {
     StateDto target = new StateDto(); // 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.");
 }
Esempio n. 5
0
 public void StateDtoConstructorTest1()
 {
     StateDto target = new StateDto();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }