Refactor IPAM model classes to use records for Address, Subnetwork, Vlan, Vrf, Section, Tag, Domain, Nameserver, and Session; enhance documentation and implement value equality for records.
This commit is contained in:
@@ -57,7 +57,7 @@ public class NameserverTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_WithEmptyNameservers_ReturnsArrayWithEmptyString()
|
||||
public void Constructor_WithEmptyNameservers_ReturnsEmptyArray()
|
||||
{
|
||||
// Arrange
|
||||
var nameServersString = "";
|
||||
@@ -65,9 +65,8 @@ public class NameserverTests
|
||||
// Act
|
||||
var nameserver = new Nameserver(1, "Test", nameServersString, "", "", null);
|
||||
|
||||
// Assert
|
||||
nameserver.NameServers.Should().HaveCount(1);
|
||||
nameserver.NameServers[0].Should().BeEmpty();
|
||||
// Assert - Empty entries are excluded
|
||||
nameserver.NameServers.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -79,4 +78,27 @@ public class NameserverTests
|
||||
// Assert
|
||||
nameserver.EditDate.Should().BeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_WithSemicolonOnlyString_ReturnsEmptyArray()
|
||||
{
|
||||
// Arrange - edge case with just semicolons
|
||||
var nameServersString = ";;;";
|
||||
|
||||
// Act
|
||||
var nameserver = new Nameserver(1, "Test", nameServersString, "", "", null);
|
||||
|
||||
// Assert
|
||||
nameserver.NameServers.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToString_ReturnsName()
|
||||
{
|
||||
// Arrange
|
||||
var nameserver = new Nameserver(1, "Google DNS", "8.8.8.8", "", "", null);
|
||||
|
||||
// Act & Assert
|
||||
nameserver.ToString().Should().Be("Google DNS");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user