示例#1
0
        public void ConvertToViewTest()
        {
            UsersProvider target   = new UsersProvider(); // TODO: Initialize to an appropriate value
            Users         item     = _Users;
            baseUsersView expected = _baseUsersView;
            baseUsersView actual;

            actual = target.ConvertToView(item);
            CompareViewObject(expected, actual);
        }
示例#2
0
        public void ConvertToModelTest()
        {
            UsersProvider target   = new UsersProvider(); // TODO: Initialize to an appropriate value
            baseUsersView item     = _baseUsersView;
            Users         expected = _Users;
            Users         actual;

            actual = target.ConvertToModel(item);
            CompareModelObject(expected, actual);
        }
示例#3
0
 private static void CompareViewObject(baseUsersView expected, baseUsersView actual)
 {
     Assert.AreEqual(expected.AccountNo, actual.AccountNo);
     Assert.AreEqual(expected.Active, actual.Active);
     Assert.AreEqual(expected.Address1, actual.Address1);
     Assert.AreEqual(expected.Address2, actual.Address2);
     Assert.AreEqual(expected.Address3, actual.Address3);
     Assert.AreEqual(expected.Bank, actual.Bank);
     Assert.AreEqual(expected.BranchCode, actual.BranchCode);
     Assert.AreEqual(expected.CellNumber, actual.CellNumber);
     Assert.AreEqual(expected.CompanyID, actual.CompanyID);
     Assert.AreEqual(expected.Email, actual.Email);
     Assert.AreEqual(expected.ID, actual.ID);
     Assert.AreEqual(expected.Password, actual.Password);
     Assert.AreEqual(expected.PaypointThreshold, actual.PaypointThreshold);
     Assert.AreEqual(expected.PhoneNumber, actual.PhoneNumber);
     Assert.AreEqual(expected.PostalCode, actual.PostalCode);
     Assert.AreEqual(expected.Username, actual.Username);
 }
示例#4
0
 public static void MyClassInitialize(TestContext testContext)
 {
     _baseUsersView = new baseUsersView()
     {
         AccountNo         = "1",
         Active            = true,
         Address1          = "add 1",
         Address2          = "add 2",
         Address3          = "add 3",
         Bank              = "bank",
         BranchCode        = "1",
         CellNumber        = "1",
         CompanyID         = 1,
         Email             = "A@A",
         ID                = 1,
         Password          = "******",
         PaypointThreshold = 1,
         PhoneNumber       = "1",
         PostalCode        = "1",
         Username          = "******"
     };
     _Users = new Users()
     {
         AccountNo         = "1",
         Active            = true,
         Address1          = "add 1",
         Address2          = "add 2",
         Address3          = "add 3",
         Bank              = "bank",
         BranchCode        = "1",
         CellNumber        = "1",
         CompanyID         = 1,
         Email             = "A@A",
         ID                = 1,
         Password          = "******",
         PaypointThreshold = 1,
         PhoneNumber       = "1",
         PostalCode        = "1",
         Username          = "******"
     };
 }
        public Users ConvertToModel(baseUsersView item)
        {
            Users model = new Users();

            model.ID                = item.ID;
            model.Username          = item.Username;
            model.Password          = item.Password;
            model.CompanyID         = item.CompanyID;
            model.Email             = item.Email;
            model.Address1          = item.Address1;
            model.Address2          = item.Address2;
            model.Address3          = item.Address3;
            model.PostalCode        = item.PostalCode;
            model.PhoneNumber       = item.PhoneNumber;
            model.CellNumber        = item.CellNumber;
            model.PaypointThreshold = item.PaypointThreshold;
            model.Bank              = item.Bank;
            model.AccountNo         = item.AccountNo;
            model.BranchCode        = item.BranchCode;
            model.Active            = item.Active;
            return(model);
        }
        public baseUsersView ConvertToView(Users item)
        {
            baseUsersView view = new baseUsersView();

            view.ID                = item.ID;
            view.Username          = item.Username;
            view.Password          = item.Password;
            view.CompanyID         = item.CompanyID;
            view.Email             = item.Email;
            view.Address1          = item.Address1;
            view.Address2          = item.Address2;
            view.Address3          = item.Address3;
            view.PostalCode        = item.PostalCode;
            view.PhoneNumber       = item.PhoneNumber;
            view.CellNumber        = item.CellNumber;
            view.PaypointThreshold = item.PaypointThreshold;
            view.Bank              = item.Bank;
            view.AccountNo         = item.AccountNo;
            view.BranchCode        = item.BranchCode;
            view.Active            = item.Active;
            return(view);
        }