예제 #1
0
        public void GenerateUser_GetInsertLine()
        {
            const string EXPECTED_RESULT = @"INSERT INTO BlogUser (Name,Surname, Patronomyc, Email)";
            string       result          = _generator.GetInsertLine();

            Assert.That(result, Is.EqualTo(EXPECTED_RESULT));
        }
예제 #2
0
        public void GenerateUser_GetInsertLine()
        {
            const string EXPECTED_RESULT = @"INSERT INTO BlogUser (Name, Surename, Patronymic, Email, Login, Password, RegistrationDate)";

            string result = _generator.GetInsertLine();

            Assert.That(result, Is.EqualTo(EXPECTED_RESULT));
        }
예제 #3
0
        public void Write(string filePath, int entityCount)
        {
            using (TextWriter writer = new StreamWriter(filePath))
            {
                string insertLine = _generator.GetInsertLine();
                writer.WriteLine(insertLine);

                for (int i = 1; i <= entityCount; i++)
                {
                    if (i > 1)
                    {
                        writer.Write(",");
                    }

                    UserEntity user      = _generator.GenerateUser();
                    string     valueLine = _generator.GetValueLine(user);
                    writer.WriteLine(valueLine);
                }
            }
        }