Beispiel #1
0
        public void GetHistoryByPerson_Success()
        {
            //Arrange
            PersonHistory_Reply reply = null;

            //var person = CreatePerson();
            //var personHistory = CreatePersonHistory();
            //Act
            if (channel == null)
            {
                channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure);
                client  = new Greeter.GreeterClient(channel);
            }
            try
            {
                reply = client.GetHistoryByPerson(new PersonId_Request {
                    Id = 1
                });
                DateTime start = DateTime.Parse(reply.Sessions[0].Start);
                Console.WriteLine($"Reply:\n{reply}");
            }
            catch (Grpc.Core.RpcException ex)
            {
                Console.WriteLine($"ERROR:\n{ex.Message}\nNot connected to service.");
            }
            //Assert
            Assert.IsNotNull(reply.Sessions);
        }