public void TestAddPublicKey() { var controller = new KvkController(new Mock <IKvkRepository>().Object); controller.AddPublicKey("123456789", "asdfghjkl"); Assert.AreEqual("asdfghjkl", PublicKeyResolver.GetPublicKey("123456789")); }
public async Task TestGetByKvkNumberReturnsJsonResponse() { var repository = new Mock <IKvkRepository>(); repository.Setup(r => r.GetByKvkNumberAsync(It.IsAny <string>())).ReturnsAsync(JsonConvert.DeserializeObject <JsonObject>("{ \"Result\": \"OK\"}")); var controller = new KvkController(repository.Object); var response = await controller.GetByKvkNumberAsync("123456789"); Assert.AreEqual("{\"Result\":\"OK\"}", response.Value.ToString()); }