Ejemplo n.º 1
0
        public void PlayerAddDtoToPlayerThrottlingDefault()
        {
            var addDto = new PlayerAddDto(Guid.Empty, "FooBar", "https://somewhere.com", NeedsThrottling: null);
            var player = fixture.Mapper.Map <Player>(addDto);

            Assert.False(player.NeedsThrottling);
        }
Ejemplo n.º 2
0
        public async Task CreateResponse()
        {
            var api = new Api();

            var data         = new PlayerAddDto(Guid.Empty, "foo", "http://dummy.com");
            var responseMock = RequestResponseMocker.Create(data, api.jsonOptions);

            var response = await api.CreateResponse(responseMock.RequestMock.Object, "dummy", HttpStatusCode.BadRequest);

            Assert.NotNull(response);
            Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
        }
Ejemplo n.º 3
0
        public async Task DeserializeAndValidateBody()
        {
            var api = new Api();

            var data         = new PlayerAddDto(Guid.Empty, "foo", "http://dummy.com");
            var responseMock = RequestResponseMocker.Create(data, api.jsonOptions);

            var(item, response) = await api.DeserializeAndValidateBody <PlayerAddDto>(responseMock.RequestMock.Object);

            Assert.NotNull(item);
            Assert.Null(response);
            Assert.Equal(data, item);
        }