public void DeserializeMetricsTest() { using (mocks.Ordered) { Expect.Once.On(mockMetricLogger).Method("Begin").With(IsMetric.Equal(new MethodInvocationDeserializeTime())); Expect.Once.On(mockMetricLogger).Method("End").With(IsMetric.Equal(new MethodInvocationDeserializeTime())); Expect.Once.On(mockMetricLogger).Method("Increment").With(IsMetric.Equal(new MethodInvocationDeserialized())); } testMethodInvocationSerializer.Deserialize("<?xml version=\"1.0\" encoding=\"utf-8\"?><MethodInvocation><MethodName>TestMethod</MethodName><Parameters><Parameter><DataType>string</DataType><Data>abc</Data></Parameter><Parameter><DataType>integer</DataType><Data>123</Data></Parameter><Parameter /><Parameter><DataType>double</DataType><Data>4.5678899999999999e+002</Data></Parameter></Parameters><ReturnType /></MethodInvocation>"); mocks.VerifyAllExpectationsHaveBeenMet(); }
public void DeserializeLoggingTest() { using (mocks.Ordered) { Expect.Once.On(mockApplicationLogger).Method("Log").With(testMethodInvocationSerializer, LogLevel.Debug, "Deserialized parameter of type '" + typeof(string).FullName + "'."); Expect.Once.On(mockApplicationLogger).Method("Log").With(testMethodInvocationSerializer, LogLevel.Debug, "Deserialized parameter of type '" + typeof(int).FullName + "'."); Expect.Once.On(mockApplicationLogger).Method("Log").With(testMethodInvocationSerializer, LogLevel.Debug, "Deserialized null parameter."); Expect.Once.On(mockApplicationLogger).Method("Log").With(testMethodInvocationSerializer, LogLevel.Debug, "Deserialized parameter of type '" + typeof(double).FullName + "'."); Expect.Once.On(mockApplicationLogger).Method("Log").With(testMethodInvocationSerializer, LogLevel.Information, "Deserialized string to method invocation 'TestMethod'."); } testMethodInvocationSerializer.Deserialize("<?xml version=\"1.0\" encoding=\"utf-8\"?><MethodInvocation><MethodName>TestMethod</MethodName><Parameters><Parameter><DataType>string</DataType><Data>abc</Data></Parameter><Parameter><DataType>integer</DataType><Data>123</Data></Parameter><Parameter /><Parameter><DataType>double</DataType><Data>4.5678899999999999e+002</Data></Parameter></Parameters><ReturnType /></MethodInvocation>"); mocks.VerifyAllExpectationsHaveBeenMet(); }