Ejemplo n.º 1
0
        public static GameServerResponse CreateMockResponse()
        {
            var mockResponseStatus = new Status
            {
                Address = "127.0.0.1",
                Ports   = new[] {
                    new PortInfo
                    {
                        Name = "http",
                        Port = 8080,
                    }
                },
                State = "Ready",
            };
            var mockResponseObjectMeta = new ObjectMeta
            {
                Name              = "mock",
                Namespace         = "default",
                Generation        = "gen1",
                ResourceVersion   = "v1",
                Uid               = "0",
                CreationTimestamp = new DateTime(2020, 1, 1, 0, 0, 0).ToString("yyyyMMdd_HHMMss"),
                Annotations       = new[]
                {
                    new Annotation
                    {
                        Key   = "key",
                        Value = "value",
                    },
                },
                Labels = new[]
                {
                    new Label
                    {
                        Key   = "key",
                        Value = "value",
                    },
                },
            };
            var response = new GameServerResponse()
            {
                ObjectMeta = mockResponseObjectMeta,
                Status     = mockResponseStatus,
            };

            return(response);
        }
Ejemplo n.º 2
0
 public MockAgonesSdk(AgonesSdkOptions options, GameServerResponse mockResponse)
 {
     Options           = options;
     this.mockResponse = mockResponse;
 }
Ejemplo n.º 3
0
 public MockAgonesSdk(AgonesSdkOptions options)
 {
     Options           = options;
     this.mockResponse = CreateMockResponse();
 }