Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        public void GetVideos_WhenCalled_CallsSerializer()
        {
            var videoService = GetVideoService();

            videoService.GetVideos();

            _serializer.AssertWasCalled(serializer =>
                                        serializer.Deserialize <IList <Panda.Domain.Video> >(Arg <string> .Is.Anything));
        }
Esempio n. 3
0
        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));
        }