コード例 #1
0
    public IEnumerator AddDeck_Wrong_Deck_Request()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_AddDeck");
            await LoomTestContext.BackendFacade.SignUp(user);

            Deck deck = new Deck
            {
                HeroId = 0,
                Name = "Gaurav",
                Cards = new List <DeckCardData>
                {
                    new DeckCardData
                    {
                        Amount = 100500,
                        CardName = "Izze"
                    }
                }
            };

            await LoomTestContext.AssertThrowsAsync(
                async() =>
            {
                await LoomTestContext.BackendFacade.AddDeck(user, deck, 0);
            });
        }));
    }
コード例 #2
0
 public IEnumerator GetDeck_Empty_Request()
 {
     return(LoomTestContext.ContractAsyncTest(
                async() =>
     {
         string user = LoomTestContext.CreateUniqueUserId("LoomTest_GetDeck");
         await LoomTestContext.BackendFacade.SignUp(user);
         Assert.IsNull(await LoomTestContext.BackendFacade.GetDecks(string.Empty));
     }));
 }
コード例 #3
0
    public IEnumerator DeleteDeck()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_DeleteDeck");
            await LoomTestContext.BackendFacade.SignUp(user);

            await LoomTestContext.BackendFacade.DeleteDeck(user, 0, 0);
        }));
    }
コード例 #4
0
 public IEnumerator DeleteDeck_Wrong_User_Request()
 {
     return(LoomTestContext.ContractAsyncTest(
                async() =>
     {
         string user = LoomTestContext.CreateUniqueUserId("LoomTest_DeleteDeck_wrong_User");
         await LoomTestContext.AssertThrowsAsync(
             async() =>
         {
             await LoomTestContext.BackendFacade.DeleteDeck(user, 0, 0);
         });
     }));
 }
コード例 #5
0
    public IEnumerator EditDeck()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_EditDeck");
            await LoomTestContext.BackendFacade.SignUp(user);

            Deck deck = new Deck
            {
                Name = "Default"
            };
            await LoomTestContext.BackendFacade.EditDeck(user, deck, 0);
        }));
    }
コード例 #6
0
    public IEnumerator AddDeck()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_AddDeck");
            await LoomTestContext.BackendFacade.SignUp(user);

            Deck deck = new Deck
            {
                HeroId = 0,
                Name = "Gaurav"
            };

            await LoomTestContext.BackendFacade.AddDeck(user, deck, 0);
        }));
    }
コード例 #7
0
    public IEnumerator GetDeck()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_GetDeck");
            await LoomTestContext.BackendFacade.SignUp(user);

            ListDecksResponse listDecksResponse = await LoomTestContext.BackendFacade.GetDecks(user);
            Assert.IsNotNull(listDecksResponse);

            DecksData decksData = JsonConvert.DeserializeObject <DecksData>(listDecksResponse.ToString());
            Assert.IsNotNull(decksData);
            Assert.AreEqual(1, decksData.Decks.Count);
            Assert.AreEqual("Default", decksData.Decks[0].Name);
        }));
    }
コード例 #8
0
    public IEnumerator EditDeck_Wrong_User_Request()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_EditDeck_wrong_user");
            Deck deck = new Deck
            {
                HeroId = 0,
                Name = "Gaurav"
            };

            await LoomTestContext.AssertThrowsAsync(
                async() =>
            {
                await LoomTestContext.BackendFacade.EditDeck(user, deck, 0);
            });
        }));
    }
コード例 #9
0
    public IEnumerator GetDeck_User_Have_No_Deck()
    {
        return(LoomTestContext.ContractAsyncTest(
                   async() =>
        {
            string user = LoomTestContext.CreateUniqueUserId("LoomTest_NoDecks");
            await LoomTestContext.BackendFacade.SignUp(user);

            ListDecksResponse listDecksResponse = null;
            Assert.IsNull(listDecksResponse);

            listDecksResponse = await LoomTestContext.BackendFacade.GetDecks(user);
            Assert.IsNotNull(listDecksResponse);

            await LoomTestContext.BackendFacade.DeleteDeck(user, 0, 0);

            ListDecksResponse newListDecksResponse = await LoomTestContext.BackendFacade.GetDecks(user);
            Assert.IsNull(newListDecksResponse);
        }));
    }