public void ResolveMagicNumbers(GetOpenPositionResponseDTO value)
        {
            if (value.OpenPosition != null)
            {
                this.ResolveMagicNumbers(value.OpenPosition);
            }

        }
Beispiel #2
0
        public void CanResolveDTO()
        {

            var rpcClient = BuildRpcClient();
            

            // this would be the value you get back from the API
            GetOpenPositionResponseDTO source = new GetOpenPositionResponseDTO
            {
                OpenPosition = new ApiOpenPositionDTO { Status = 1 }
            };

            rpcClient.MagicNumberResolver.ResolveMagicNumbers(source);

            Assert.AreEqual("Pending", source.OpenPosition.Status_Resolved, "status reason not resolved");

            rpcClient.LogOut();
        }
        public void CanResolveDTOVersion2()
        {

            var rpcClient = new Client(Settings.RpcUri);
            rpcClient.LogIn(Settings.RpcUserName, Settings.RpcPassword);


            // this would be the value you get back from the API
            GetOpenPositionResponseDTO dto = new GetOpenPositionResponseDTO
            {
                OpenPosition = new ApiOpenPositionDTO { Status = 1 }
            };

            rpcClient.MagicNumberResolver.ResolveMagicNumbers(dto);
            

            Assert.AreEqual("Pending", dto.OpenPosition.Status_Resolved, "status reason not resolved");

            rpcClient.LogOut();
        }