public void GetControllerDocumentation_WhenControllerTypeIsTestController_CallsSerializeObjectWithGetApiResourceResult() { var expected = new SwaggerApiResource(); _swaggerDocumentationCreator.Stub(x => x.GetApiResource(typeof(TestController), null)).Return(expected); _swaggerApiDocumentation.GetControllerDocumentation(typeof(TestController), null); _jsonSerializer.AssertWasCalled(x => x.SerializeObject(expected)); }
public void GetVideos_WhenCalled_CallsSerializer() { var videoService = GetVideoService(); videoService.GetVideos(); _serializer.AssertWasCalled(serializer => serializer.Deserialize <IList <Panda.Domain.Video> >(Arg <string> .Is.Anything)); }
public void When_AddCar_calls_SerializedObject_method() { //Arrange var car = new CarBuilder() .WithDoors(NumberOfDoors.Four) .WithColor(Color.Thunder) .WithAbs(true) .Build(); //Act _sut.AddCar(car); //Asert _jsonSerializerMock.AssertWasCalled(x => x.SerializeObject(Arg <object> .Is.Anything)); }