Exemplo n.º 1
0
        public async Task GetSpartanImage_IsSerializable(string gamertag, int size, Enumeration.Halo5.CropType crop)
        {
            var query = new GetSpartanImage(gamertag)
                        .Size(size)
                        .Crop(crop)
                        .SkipCache();

            var result = await Global.Session.Query(query);

            SerializationUtility <HaloImage> .AssertRoundTripSerializationIsPossible(result);
        }
Exemplo n.º 2
0
        public async Task GetSpartanImage(string gamertag, int size, Enumeration.Halo5.CropType crop)
        {
            var query = new GetSpartanImage(gamertag)
                        .Size(size)
                        .Crop(crop)
                        .SkipCache();

            var result = await Global.Session.Query(query);

            Assert.IsInstanceOf(typeof(HaloImage), result);
        }
Exemplo n.º 3
0
        public void Uri_MatchesExpected(string gamertag, int size, Enumeration.Halo5.CropType crop)
        {
            var query = new GetSpartanImage(gamertag);

            Assert.AreEqual($"https://www.haloapi.com/profile/h5/profiles/{gamertag}/spartan", query.Uri);

            query.Size(size);

            Assert.AreEqual($"https://www.haloapi.com/profile/h5/profiles/{gamertag}/spartan?size={size}", query.Uri);

            query.Crop(crop);

            Assert.AreEqual($"https://www.haloapi.com/profile/h5/profiles/{gamertag}/spartan?size={size}&crop={crop}", query.Uri);
        }
Exemplo n.º 4
0
        public GetSpartanImage Crop(Enumeration.Halo5.CropType cropType)
        {
            _parameters[CropParameter] = cropType.ToString();

            return(this);
        }