Esempio n. 1
0
        public void TestExecuteShouldReturnSaleDetail()
        {
            var result = _query.Execute(SaleId);

            Assert.That(result.Id,
                        Is.EqualTo(SaleId));

            Assert.That(result.Date,
                        Is.EqualTo(Date));

            Assert.That(result.CustomerName,
                        Is.EqualTo(CustomerName));

            Assert.That(result.EmployeeName,
                        Is.EqualTo(EmployeeName));

            Assert.That(result.ProductName,
                        Is.EqualTo(ProductName));

            Assert.That(result.UnitPrice,
                        Is.EqualTo(UnitPrice));

            Assert.That(result.Quantity,
                        Is.EqualTo(Quantity));

            Assert.That(result.TotalPrice,
                        Is.EqualTo(TotalPrice));
        }
        public void TestExecuteShouldReturnSaleDetail()
        {
            _mocker.GetMock <IDbSet <Sale> >()
            .SetUpDbSet(new List <Sale> {
                _sale
            });

            _mocker.GetMock <IDatabaseService>()
            .Setup(p => p.Sales)
            .Returns(_mocker.GetMock <IDbSet <Sale> >().Object);

            var result = _query.Execute(SaleId);

            Assert.That(
                result.Id,
                Is.EqualTo(SaleId));

            Assert.That(
                result.Date,
                Is.EqualTo(Date));

            Assert.That(
                result.CustomerName,
                Is.EqualTo(CustomerName));

            Assert.That(
                result.EmployeeName,
                Is.EqualTo(EmployeeName));

            Assert.That(
                result.ProductName,
                Is.EqualTo(ProductName));

            Assert.That(
                result.UnitPrice,
                Is.EqualTo(UnitPrice));

            Assert.That(
                result.Quantity,
                Is.EqualTo(Quantity));

            Assert.That(
                result.TotalPrice,
                Is.EqualTo(TotalPrice));
        }