Beispiel #1
0
 public void InitializeShouldLogFirstAndLastElementAndRandom()
 {
     contextMock.Setup(c => c.GetProperty(ScenarioWorker.GetPropertyKey("random"), It.IsAny <string>())).Returns(bool.TrueString);
     contextMock.Setup(c => c.GetProperty(ScenarioWorker.GetPropertyKey("seed"), It.IsAny <string>())).Returns("345");
     scenaroio.Initialize();
     loggerMock.Verify(l => l.Info("OnInitialize: FirstElement = 1, LastElement = 100, IsRandom = True, Seed = 345"));
 }
Beispiel #2
0
 public void InitializeShouldNotInitializeRandomWhenRandomPropertyIsFalse()
 {
     contextMock.Setup(c => c.GetProperty(ScenarioWorker.GetPropertyKey("random"), It.IsAny <string>())).Returns(bool.FalseString);
     scenaroio.Initialize();
     Assert.That(scenaroio.Random, Is.Null);
 }
Beispiel #3
0
 public void InitializeShouldUseRandomValueWhenRandomPropertyIsProvided()
 {
     contextMock.Setup(c => c.GetProperty(ScenarioWorker.GetPropertyKey("random"), It.IsAny <string>())).Returns(bool.FalseString);
     scenaroio.Initialize();
     Assert.That(scenaroio.IsRandom, Is.False);
 }
Beispiel #4
0
 public void LastElementPropertyShouldBeNotBeLessThanFirstElement()
 {
     contextMock.Setup(c => c.GetProperty(ScenarioWorker.GetPropertyKey("lastElement"), "100")).Returns("0");
     Assert.Throws(Is.TypeOf <ArgumentException>().And.Message.EqualTo("Property 'grinderscript-dotnet.scenarioWorker.lastElement' can not be < 'grinderscript-dotnet.scenarioWorker.firstElement' (1), but was 0"), () => scenaroio.Initialize());
 }
Beispiel #5
0
 public void InitializeShouldUseDefaultLastElementWhenPropertyIsMissing()
 {
     scenaroio.Initialize();
     contextMock.Verify(c => c.GetProperty(ScenarioWorker.GetElementPropertyKey(100, "workerType")));
 }
Beispiel #6
0
 public void InitializeShouldUseLastElementValueWhenPropertyIsProvided()
 {
     contextMock.Setup(c => c.GetProperty(ScenarioWorker.GetPropertyKey("lastElement"), "100")).Returns("3");
     scenaroio.Initialize();
     contextMock.Verify(c => c.GetProperty(ScenarioWorker.GetElementPropertyKey(100, "workerType")), Times.Never());
 }