public void DomainManager_ThrowsIfNotSet()
        {
            // Arrange
            TableControllerMock       ctrl = new TableControllerMock();
            InvalidOperationException ex   = Assert.Throws <InvalidOperationException>(() => ctrl.DomainManager);

            // Assert
            Assert.Equal("The 'DomainManager' property has not been initialized. Please initialize the property with a 'IDomainManager' instance.", ex.Message);
        }
        public void DomainManager_SoftDeleteIsDisabled_IfParameterIsFalse()
        {
            // Arrange
            var controller1    = new TableControllerMock <TestEntity>();
            var domainManager1 = new Mock <DomainManager <TestEntity> >(new HttpRequestMessage(), false);

            controller1.DomainManager = domainManager1.Object;

            // Assert
            Assert.Equal(false, domainManager1.Object.EnableSoftDelete);
            Assert.Equal(true, domainManager1.Object.IncludeDeleted);
        }
 public TableControllerOfDataTests()
 {
     this.patch = new Delta <TestEntity>();
     this.data  = new TestEntity {
         BooleanValue = true, Id = Id, IntValue = 42
     };
     this.exception         = new Exception("Catch this!");
     this.response          = new HttpResponseMessage(HttpStatusCode.Conflict);
     this.responseException = new HttpResponseException(this.response);
     this.domainManagerMock = new Mock <DomainManager <TestEntity> >(new HttpRequestMessage(), false);
     this.domainManager     = this.domainManagerMock.Object;
     this.controller        = new TableControllerMock(this.domainManager);
 }