Beispiel #1
0
        public void Should_throw_invalid_operation_exception_when_production_area_does_not_exist_and_not_using_transformer()
        {
            using (var store = NewDocumentStore())
            {
                new ProductionAreaTransformer().Execute(store);

                using (var session = store.OpenSession())
                {
                    // Arrange
                    var productionArea = new ProductionArea {
                        Name = "Production Area 1"
                    };
                    session.Store(productionArea);
                    var productionAreaId = productionArea.Id;
                    session.SaveChanges();

                    var service = new ProducerService(session);

                    // Act
                    const string badProductionAreaId = "ProductionAreas-9999";

                    // Assert
                    Assert.Throws <InvalidOperationException>(() => service.GetProductionAreaWithoutTransformer(badProductionAreaId));
                }
            }
        }