Ejemplo n.º 1
0
        public async Task PublicInfoAsync_Successfully_returns_a_GetPublicAlliance()
        {
            int allianceId = 8762;

            LatestAllianceEndpoints latestAlliance = new LatestAllianceEndpoints(string.Empty, true);

            V3AlliancePublicInfo infoInfo = await latestAlliance.PublicInfoAsync(allianceId);

            Assert.Equal("C C P Alliance", infoInfo.Name);
            Assert.Equal(DateTime.Parse("2016-06-26T21:00:00"), infoInfo.DateFounded);
        }
        public async Task PublicInfoAsync_Successfully_returns_a_GetPublicAlliance()
        {
            Mock <IWebClient> mockedWebClient = new Mock <IWebClient>();

            string json = "{\"name\": \"C C P Alliance\",\"ticker\": \"<C C P>\",\"creator_id\": 12345,\"creator_corporation_id\": 45678,\"executor_corporation_id\": 98356193,\"date_founded\": \"2016-06-26T21:00:00Z\"}";

            int allianceId = 8762;

            mockedWebClient.Setup(x => x.GetAsync(It.IsAny <WebHeaderCollection>(), It.IsAny <string>(), It.IsAny <int>())).ReturnsAsync(new EsiModel {
                Model = json
            });

            InternalLatestAlliance internalLatestAlliance = new InternalLatestAlliance(mockedWebClient.Object, string.Empty);

            V3AlliancePublicInfo infoInfo = await internalLatestAlliance.PublicInfoAsync(allianceId);

            Assert.Equal("C C P Alliance", infoInfo.Name);
            Assert.Equal(DateTime.Parse("2016-06-26T21:00:00"), infoInfo.DateFounded);
        }