Пример #1
0
        static void Main(string[] args)
        {
            //TupleTest ts = new TupleTest(233, 322);
            //Console.WriteLine(ts.getData1().Item1 + "  " + ts.getData1().Item2);
            //ListProducts lst1 = new ListProducts();

            //lst1[0] = new Product { id = 23, tensp = "ko biet" };

            //Console.WriteLine(lst1[0].id);


            //AbClass sd = new AbClass { number = 2, number2 = 34 };


            //Console.WriteLine(DaoNguocTen("  a  Nguyen Binh An s ") + "||||");
            //TamGiacCan(8);

            ConcreteClass1 c1 = new ConcreteClass1();
            ConcreteClass1 c2 = new ConcreteClass1();
            ConcreteClass1 c3 = new ConcreteClass1();
            Ab_Class1      c4 = new ConcreteClass1();

            Console.WriteLine(c1.getNCon());
            Console.WriteLine(c1.getNNumber());

            User user = new User.Builder().setName("An").setId(1).build();
        }
 public User ToDomain(UserDto dto)
 {
     Preconditions.CheckNotNull(dto);
     User.Builder builder = new User.Builder();
     builder.SetId(dto.Id)
     .SetLogin(dto.Login)
     .SetPassword(dto.Password)
     .SetRegistrationDateTime(dto.RegistrationDateTime);
     return(builder.Build());
 }
Пример #3
0
        public void CreateNewUser()
        {
            //Arrange
            const string FIRST = "First";
            const string LAST  = "Last";
            //Act
            User user = new User.Builder().WithFirstName(FIRST).WithLastName(LAST).Build();

            //Assert
            Assert.AreNotEqual(user.Guid, Guid.Empty);
            Assert.AreEqual(user.FirstName, FIRST);
            Assert.AreEqual(user.LastName, LAST);
        }
Пример #4
0
        public void CreateNewUserDTO()
        {
            //Arrange
            const string FIRST = "First";
            const string LAST  = "Last";
            //Act
            User    user    = new User.Builder().WithFirstName(FIRST).WithLastName(LAST).Build();
            UserDTO userDTO = new UserDTO.Builder().WithUser(user).Build();

            //Assert
            Assert.AreEqual(user.Guid, userDTO.Guid);
            Assert.AreEqual(user.FirstName, userDTO.FirstName);
            Assert.AreEqual(user.LastName, userDTO.LastName);
        }