Example #1
0
        public void SaveCompanyTestCase()
        {
            var targetCompany = new Domain.Company
            {
                Excluded          = false,
                LegalPersonDetail = new Domain.SubEntity.LegalPersonDetail
                {
                    Cnpj = new Domain.SubEntity.Cnpj
                    {
                        CheckNumber = 12,
                        Root        = 12345,
                        Suffix      = 12
                    },
                    CompanyName = "Bad Cat Corporation S/A",
                    TradingName = "BadCat SA",
                    IE          = 123456
                }
            };

            CompanyDao.Save(targetCompany);

            ResultInspector.AreEqual(ResultInspector.GetExpectedTable(
                                         "Schemas.ErpSchema.xsd",
                                         "Dataset.InsertedCompany.xml",
                                         "tb_company"
                                         ),
                                     GetCompanies()
                                     );
        }
Example #2
0
        private DataTable GetCompanies()
        {
            string fields = " * ";
            string query  = "SELECT * \r\n" +
                            "FROM Customers " + "\r\n" +
                            "JOIN Orders ON (Customers.CustomerID = Orders.CustomerID )" + "\r\n" +
                            "JOIN Employees ON (Orders.EmployeeID = Employees.EmployeeID)" + "\r\n" +
                            "ORDER BY " + fields;

            return(ResultInspector.Load(ConnectionString, query));
        }
Example #3
0
        public void TestSaveState()
        {
            var target = new StateDaoNhibernate();

            target.NhibernateSession = base.NhibernateSession;
            var state = new State()
            {
                Name = "Rio de Janeiro"
            };

            target.Save(state);

            Assert.IsTrue(
                ResultInspector.AreEqual(
                    ResultInspector.LoadPartial <DatabaseSchema>(ConnectionString, "TB_STATE", "SELECT NAME FROM TB_STATE").Tables["TB_STATE"],
                    ResultInspector.GetExpectedTable("Schema.DatabaseSchema.xsd", "Dataset.ExpectedInsertState.xml", "TB_STATE")
                    )
                );
        }