Exemplo n.º 1
0
        public void GetByFactuurnummer_Should_ReturnBevestigdeBestellingWithCertainId_When_Factuurnummer_IsGiven()
        {
            // Arrange
            BevestigdeBestelling bevestigdeBestelling = new BevestigdeBestellingBuilder().SetDummy().Create();

            _context.BevestigdeBestellingen.Add(bevestigdeBestelling);
            _context.SaveChanges();

            // Act
            BevestigdeBestelling result = _target.GetByFactuurnummer(bevestigdeBestelling.Factuurnummer);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(bevestigdeBestelling.IsEqual(result));
        }
        public void Insert_Should_InsertArtikel_When_NieuwArtikel_IsGiven()
        {
            // Arrange
            Bestelling bestelling = new BestellingBuilder().SetDummy().Create();

            var dataMapper = new BestellingDataMapper(_context);

            // Act
            dataMapper.Insert(bestelling);

            Bestelling result = dataMapper.GetByFactuurnummer(bestelling.Factuurnummer);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(bestelling.IsEqual(result));
        }
Exemplo n.º 3
0
        public void GetByFactuurnummer_Should_ReturnBestellingWithCertainId_When_Factuurnummer_IsGiven()
        {
            // Arrange
            Bestelling bestelling = new BestellingBuilder().SetDummy().Create();

            _betaalContext.Bestellingen.Add(bestelling);
            _betaalContext.SaveChanges();

            var dataMapper = new BestellingDataMapper(_betaalContext);

            // Act
            Bestelling result = dataMapper.GetByFactuurnummer(bestelling.Factuurnummer);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(bestelling.Factuurnummer, result.Factuurnummer);
        }
        public void Update_ShouldUpdateBestelling_When_AnUpdatedBestelling_IsGiven()
        {
            // Arrange
            Bestelling bestelling       = new BestellingBuilder().SetDummy().Create();
            Bestelling bestellingUpdate = bestelling;

            bestellingUpdate.BestelStatus = BestelStatus.Goedgekeurd;

            var dataMapper = new BestellingDataMapper(_context);

            dataMapper.Insert(bestelling);

            // Act
            dataMapper.Update(bestellingUpdate);
            Bestelling result = dataMapper.GetByFactuurnummer(bestellingUpdate.Factuurnummer);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.IsEqual(bestellingUpdate));
        }