public void GenerateDoubleSingle() { var mockSuit = new Mock <Suit>(); var primitiveGenerator = new PrimitiveGenerator(mockSuit.Object); mockSuit.Setup(i => i.GeneratePrimitive <double>("test", It.IsAny <ISessionManager>())) .Returns(10d); var result = primitiveGenerator.Double("test"); Assert.Equal(10d, result); mockSuit.Verify(i => i.GeneratePrimitive <double>("test", It.IsAny <ISessionManager>())); }
public void GenerateDoubleList(int times) { var mockSuit = new Mock <Suit>(); var primitiveGenerator = new PrimitiveGenerator(mockSuit.Object); mockSuit.Setup(i => i.GeneratePrimitive <double>("test", It.IsAny <ISessionManager>())) .Returns(10d); var result = primitiveGenerator.Double("test", count: times); Assert.All(result, i => Assert.Equal(10d, i)); mockSuit.Verify(i => i.GeneratePrimitive <double>("test", It.IsAny <ISessionManager>()), Times.Exactly(times)); }