public void ShouldGetAuditDbContextConfigurationFromXml_ReturnsDefaultIfNonExisting() { // Arrange var configPath = Assembly.GetCallingAssembly().Location; // Act var auditDbContextConfiguration = AuditDbContextConfigurationManager.GetAuditDbContextConfigurationFromXml(configPath); // Assert auditDbContextConfiguration.Should().NotBeNull(); auditDbContextConfiguration.AuditEnabled.Should().BeTrue(); auditDbContextConfiguration.AuditDateTimeKind.Should().Be(DateTimeKind.Utc); auditDbContextConfiguration.AuditTypeInfos.Should().HaveCount(0); }
public void ShouldGetAuditDbContextConfigurationFromXml() { // Act var auditDbContextConfiguration = AuditDbContextConfigurationManager.GetAuditDbContextConfigurationFromXml(); // Assert auditDbContextConfiguration.Should().NotBeNull(); auditDbContextConfiguration.AuditEnabled.Should().BeTrue(); auditDbContextConfiguration.AuditDateTimeKind.Should().Be(DateTimeKind.Utc); auditDbContextConfiguration.AuditTypeInfos.Should().HaveCount(1); var auditTypeInfo = auditDbContextConfiguration.AuditTypeInfos.ElementAt(0); auditTypeInfo.AuditEntityType.Should().Be(typeof(EmployeeAudit)); auditTypeInfo.AuditableEntityType.Should().Be(typeof(Employee)); auditTypeInfo.AuditProperties.Should().BeEmpty(); }