public void Create_WhenParametersCorrect_ExpectJsonReturned() { // Arrange const int numberOfItems = 1; const int mean = 10000; const int standardDeviation = 10000; const int significantDigits = 2; JObject expected = new JObject( new JProperty(JsonRpcConstants.NUMBER_ITEMS_RETURNED_PARAMETER_NAME, numberOfItems), new JProperty(JsonRpcConstants.MEAN_PARAMETER_NAME, mean), new JProperty(JsonRpcConstants.STANDARD_DEVIATION_PARAMETER_NAME, standardDeviation), new JProperty(JsonRpcConstants.SIGNIFICANT_DIGITS_PARAMETER_NAME, significantDigits) ); // Act var parameters = GuassianParameters.Create(numberOfItems, mean, standardDeviation, significantDigits); var target = new GuassianJsonRequestBuilder(); var actual = target.Build(parameters); // Assert actual.Should().Equal(expected); }
public void Create_WhenParametersNull_ExpectException() { // Arrange var target = new GuassianJsonRequestBuilder(); target.Build(null); // Assert }
public void Create_WhenParametersNotTypeOfBlobParameter_ExpectException() { // Arrange Mock<IParameters> parameters = new Mock<IParameters>(); var target = new GuassianJsonRequestBuilder(); target.Build(parameters.Object); // Assert }