Ejemplo n.º 1
0
 public void ShouldNotReadInexistingKey(Cloud cloud)
 {
     cloud.LoginAnonymously().ExpectSuccess(gamer => {
         gamer.GamerVfs.GetKey("nonexistingkey")
         .ExpectFailure(getRes => {
             Assert(getRes.HttpStatusCode == 404, "Wrong error code (404)");
             Assert(getRes.ServerData["name"] == "KeyNotFound", "Wrong error message");
             CompleteTest();
         });
     });
 }
Ejemplo n.º 2
0
 public void ShouldConvertAccount(Cloud cloud)
 {
     // Create an anonymous account
     cloud.LoginAnonymously()
     // Then convert it to e-mail
     .Then(gamer => gamer.Account.Convert(
         network: LoginNetwork.Email,
         networkId: RandomEmailAddress(),
         networkSecret: "Password123"))
     .Then(conversionResult => {
         Assert(conversionResult, "Convert account failed");
     })
     .CompleteTestIfSuccessful();
 }
Ejemplo n.º 3
0
 public void ShouldModifyGamerAfterConvertingAccount(Cloud cloud)
 {
     Gamer[] gamer = new Gamer[1];
     // Create an anonymous account
     cloud.LoginAnonymously()
     // Then convert it to e-mail
     .Then(g => {
         gamer[0] = g;
         return g.Account.Convert(
             network: LoginNetwork.Email,
             networkId: RandomEmailAddress(),
             networkSecret: "Password123");
     })
     .Then(done => {
         Assert(gamer[0].Network == LoginNetwork.Email, "The gamer object failed to change");
         CompleteTest();
     })
     .CompleteTestIfSuccessful();
 }
Ejemplo n.º 4
0
 public void ShouldLoginAnonymously(Cloud cloud)
 {
     cloud.LoginAnonymously()
     .ExpectSuccess(result => {
         Assert(result != null, "Failed to fetch a gamer object");
         CompleteTest();
     });
 }
Ejemplo n.º 5
0
 public void ShouldFailToLinkAccount(Cloud cloud)
 {
     // Create an anonymous account
     cloud.LoginAnonymously()
         // Then convert it to e-mail
     .Then(gamer => gamer.Account.Link(
         network: LoginNetwork.Facebook,
         networkId: "10153057921478191",
         networkSecret: "CAAENyTNQMpQBAETZCetNwCP1EKlykqqjaPRTNI41fhmf0YSZB6Q3hdOtb4gnDIQznGyElGIuBy3ZCoUNiekZBhIXh4iHho8wODALDw3ZBesfzbmGSH5BPWjwp8ieMIZANA7igvqNw6zVj7LIsSO9wtkvGaA9iZBMXF0wymmiDEljQVo03jsvlf7GZCZBckjYDBnwSm929Sl8wegZDZD"))
     .CompleteTestIfSuccessful();
 }
Ejemplo n.º 6
0
 public void ShouldFailToConvertToExistingAccount(Cloud cloud)
 {
     // Ensures that a fake account has been created
     cloud.Login(
         network: LoginNetwork.Email,
         networkId: "*****@*****.**",
         networkSecret: "Password123")
     .ExpectSuccess(dummyGamer => {
         // Create an anonymous account
         return cloud.LoginAnonymously();
     })
     .ExpectSuccess(gamer => {
         // Then try to convert it to the same e-mail as the fake account created at first
         gamer.Account.Convert(
             network: LoginNetwork.Email,
             networkId: "*****@*****.**",
             networkSecret: "Anotherp4ss")
         .ExpectFailure(conversionResult => {
             Assert(conversionResult.HttpStatusCode == 400, "400 expected");
             Assert(conversionResult.ServerData["message"] == "UserExists", "UserExists error expected");
             CompleteTest();
         });
     });
 }