コード例 #1
0
        public void ValuesFormatterFactoryReturnsAnimeValuesFormatter()
        {
            var sut = Fixture.Factory;

            var animeValues     = new AnimeValues();
            var valuesFormatter = sut.Create(animeValues);

            Assert.IsType <AnimeValuesFormatter>(valuesFormatter);
        }
コード例 #2
0
        public void AnimeDataShouldMatchFormattedAnimeValuesObjectString()
        {
            AnimeValues values    = _animeValuesFixture.Values;
            string      xmlString = _formatterFixture.ValuesFormatter.Format(values);

            var thatXmlAreIdentical = XmlFilesAreIdentical(_animeData, xmlString);

            Assert.True(thatXmlAreIdentical);
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: dance2die/MyAnimeListSharp
        private static void TestAddAnimeByObject(ICredentialContext credential)
        {
            var methods     = new AnimeListMethods(credential);
            var animeValues = new AnimeValues
            {
                AnimeStatus = AnimeStatus.Watching,
                Comments    = "It was a great series."
            };
            var responseText = methods.AddAnime(ANIME_ID, animeValues);

            Console.WriteLine(responseText);
        }
コード例 #4
0
        private static void UpdateAnimeValue(CredentialContext credential)
        {
            var   animeId    = 32615; // Youjo Senki (TV)
            short epsWatched = 6;
            var   persScore  = 8;

            var methods = new AnimeListMethods(credential);

            AnimeValues animeValues = new AnimeValues
            {
                Episode = epsWatched,
                Score   = (Score)persScore
            };

            var response = methods.UpdateAnime(animeId, animeValues);

            Console.WriteLine(response);
        }
コード例 #5
0
        /// <summary>
        /// Update Anime info by ID
        /// </summary>
        /// <param name="id">Anime ID on MyAnimeList.net</param>
        /// <param name="animeValues">object that represents XML specification</param>
        /// <returns>Response from the server in raw string whether anime was added correctly or not</returns>
        public string UpdateAnime(int?id, AnimeValues animeValues)
        {
            var data = GetDataStringFromMyAnimeListValues(animeValues);

            return(UpdateAnime(id, data));
        }
コード例 #6
0
        public async Task <string> UpdateAnimeAsync(int?id, AnimeValues animeValues)
        {
            var data = GetDataStringFromMyAnimeListValues(animeValues);

            return(await UpdateAnimeAsync(id, data));
        }
コード例 #7
0
 public AnimeValuesTest(CredentialContextFixture credentialContextFixture, ITestOutputHelper output)
     : base(credentialContextFixture)
 {
     _output = output;
     _sut    = new AnimeValues();
 }