Skip to content

Commit

Permalink
NetworkIdentifier is missing in generated Model Design for DI model #629
Browse files Browse the repository at this point in the history


- improved CalculateNodeReferencesNullUANodeTest
  • Loading branch information
mpostol committed Mar 12, 2022
1 parent 3d76ee0 commit 910d1cd
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,27 +188,15 @@ public void UpdateWithDifferentNodeIdTest()
}

[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
public void CalculateNodeReferencesNullFactoryTest()
{
Mock<IAddressSpaceBuildContext> _addressSpaceMock = new Mock<IAddressSpaceBuildContext>();
Mock<IValidator> _validatorMoc = new Mock<IValidator>();
List<TraceMessage> _traceBuffer = new List<TraceMessage>();
IUANodeBase _first = new UANodeContext(NodeId.Parse("ns=1;i=11"), _addressSpaceMock.Object, x => _traceBuffer.Add(x));
_first.CalculateNodeReferences(null, _validatorMoc.Object);
Assert.AreEqual<int>(0, _traceBuffer.Count);
}

[TestMethod]
[ExpectedException(typeof(ArgumentNullException))]
public void CalculateNodeReferencesValidatorIsNullTest()
public void CalculateNodeReferencesNullArguments()
{
Mock<IAddressSpaceBuildContext> _addressSpaceMock = new Mock<IAddressSpaceBuildContext>();
Mock<INodeFactory> _mockNodeFactory = new Mock<INodeFactory>();
Mock<IValidator> _validatorMoc = new Mock<IValidator>();
List<TraceMessage> _traceBuffer = new List<TraceMessage>();
IUANodeBase _first = new UANodeContext(NodeId.Parse("ns=1;i=11"), _addressSpaceMock.Object, x => _traceBuffer.Add(x));
_first.CalculateNodeReferences(_mockNodeFactory.Object, null);
Assert.AreEqual<int>(0, _traceBuffer.Count);
Assert.ThrowsException<ArgumentNullException>(() => _first.CalculateNodeReferences(null, _validatorMoc.Object));
Assert.ThrowsException<ArgumentNullException>(() => _first.CalculateNodeReferences(_mockNodeFactory.Object, null));
}

[TestMethod]
Expand Down

0 comments on commit 910d1cd

Please sign in to comment.