Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ public void Ctor_InvalidContexType_ThrowsInvalidEnumArgumentException(ContextTyp
[Fact]
public void Ctor_DomainContextType_ThrowsPrincipalServerDownException()
{
Assert.Throws<PrincipalServerDownException>(() => new PrincipalContext(ContextType.Domain));
if (Environment.MachineName.Equals(Environment.UserDomainName, StringComparison.OrdinalIgnoreCase))
{
// The machine is not connected to a domain. we expect PrincipalContext(ContextType.Domain) to throw
Assert.Throws<PrincipalServerDownException>(() => new PrincipalContext(ContextType.Domain));
}
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ public class SearchResultEntry
{
private DirectoryControl[] _resultControls = null;

internal SearchResultEntry(string dn) => DistinguishedName = dn;
internal SearchResultEntry(string dn) : this(dn, new SearchResultAttributeCollection()) {}

internal SearchResultEntry(string dn, SearchResultAttributeCollection attrs) : this(dn)
internal SearchResultEntry(string dn, SearchResultAttributeCollection attrs)
{
DistinguishedName = dn;
Attributes = attrs;
}

Expand Down