public void KingShan_Has_Secured_3_Allies_And_IstheRuler_SecretMessageUpperCase() { //Arrange var process = new AlliesProcess(); var requests = new AllianceRequest[] { new AllianceRequest() { Country = "AIR", SecretMessage = "oaaawaala".ToUpper() }, new AllianceRequest() { Country = "LAND", SecretMessage = "a1d22n333a4444p".ToUpper() }, new AllianceRequest() { Country = "ICE", SecretMessage = "zmzmzmzaztzozh".ToUpper() } }; //Act var result = process.EvaluateAlliance(requests, "space"); //Assert Assert.AreEqual <string>(result.RulerName, "King Shan"); Assert.AreEqual <int>(result.Allies.Count(), 3); }
public void KingShan_CouldNotSecureAllies() { //Arrange var process = new AlliesProcess(); var requests = new AllianceRequest[] { new AllianceRequest() { Country = "AIR", SecretMessage = "osqsls".ToUpper() }, new AllianceRequest() { Country = "LAND", SecretMessage = "a1d22n333a4444p".ToUpper() }, new AllianceRequest() { Country = "ICE", SecretMessage = "zmzmzmzaztzozh".ToUpper() } }; //Act var result = process.EvaluateAlliance(requests, "space"); //Assert Assert.AreEqual <string>(result.RulerName, "None"); Assert.AreEqual <int>(result.Allies.Count(), 0); }
public void KingShanHas_SentDifferentMessage_ToSameCountry() { //Arrange var process = new AlliesProcess(); var requests = new AllianceRequest[] { new AllianceRequest() { Country = "Air", SecretMessage = "oaaawaala" }, new AllianceRequest() { Country = "Land", SecretMessage = "a1d22n333a4444p" }, new AllianceRequest() { Country = "Ice", SecretMessage = "zmzmzmzaztzozh" }, new AllianceRequest() { Country = "Air", SecretMessage = "oaaawaala" } }; //Act var result = process.EvaluateAlliance(requests, "space"); //Assert Assert.AreEqual <string>(result.RulerName, "King Shan"); Assert.AreEqual <int>(result.Allies.Count(), 3); }
public void Method_Invoked_With_InvalidCountry() { //Arrange var process = new AlliesProcess(); var requests = new AllianceRequest[] { new AllianceRequest() { Country = "INVALID_COUNTRY", SecretMessage = "oaaawaala".ToUpper() }, new AllianceRequest() { Country = "LAND", SecretMessage = "a1d22n333a4444p".ToUpper() }, new AllianceRequest() { Country = "ICE", SecretMessage = "zmzmzmzaztzozh".ToUpper() } }; //Act var result = process.EvaluateAlliance(requests, "space"); }
public void KingShan_Sends_Same_Message_MultipleTimes() { //Arrange var process = new AlliesProcess(); var requests = new AllianceRequest[] { new AllianceRequest() { Country = "Air", SecretMessage = "oaaawaala" }, new AllianceRequest() { Country = "Air", SecretMessage = "oaaawaala" }, new AllianceRequest() { Country = "Air", SecretMessage = "oaaawaala" } }; //Act var result = process.EvaluateAlliance(requests, "space"); //Assert Assert.AreEqual <string>(result.RulerName, "None"); }
public void KingShan_Has_Secured_3_Allies_And_IstheRuler_CheckUIFriendlyAllies() { //Arrange var process = new AlliesProcess(); var requests = new AllianceRequest[] { new AllianceRequest() { Country = "AIR", SecretMessage = "oaaawaala".ToUpper() }, new AllianceRequest() { Country = "LAND", SecretMessage = "a1d22n333a4444p".ToUpper() }, new AllianceRequest() { Country = "ICE", SecretMessage = "zmzmzmzaztzozh".ToUpper() } }; //Act var result = process.EvaluateAlliance(requests, "space"); //Assert Assert.AreEqual <string>(result.UIFriendlyListOfAllies, "Air, Land, Ice"); }
public Task UpdateAsync(AllianceRequest alliance) { throw new NotImplementedException(); }
public async Task CreateAsync(AllianceRequest newAllianceRequest) { await _context.AllianceRequests.AddAsync(newAllianceRequest); await _context.SaveChangesAsync(); }