public async Task CannotCreateStorytellerIfAlreadyExists_ReturnException() { Storyteller storyteller = new Storyteller("Name", 1, true, "img.png", "About", 18) { Id = "5050241f-a600-4d64-8634-0de904c043c1", AccessFailedCount = 0, EmailConfirmed = false, PhoneNumberConfirmed = false, TwoFactorEnabled = false, LockoutEnabled = false, UserName = "******", NormalizedUserName = "******", Email = "*****@*****.**", NormalizedEmail = "*****@*****.**", PasswordHash = "Pasfjdsasd", ConcurrencyStamp = "fjjffjfjf", LockoutEnd = DateTime.Now, PhoneNumber = "885553531", SecurityStamp = "Securitystamp", }; IStorytellerCRUD storytellerService1 = new StorytellerService(); IStorytellerCRUD storytellerService2 = new StorytellerService(); IStorytellerCRUD storytellerService3 = new StorytellerService(); await storytellerService1.CreateStoryteller(storyteller); await storytellerService2.CreateStoryteller(storyteller); await storytellerService3.DeleteStorytellerById(storyteller.Id); }
public void CanCreateValidStoryteller_ReturnId() { Storyteller storyteller = new Storyteller("Name", 1, true, "img.png", "About", 18) { Id = "5050241f-a600-4d64-8634-0de904c043c1", AccessFailedCount = 0, EmailConfirmed = false, PhoneNumberConfirmed = false, TwoFactorEnabled = false, LockoutEnabled = false, UserName = "******", NormalizedUserName = "******", Email = "*****@*****.**", NormalizedEmail = "*****@*****.**", PasswordHash = "Pasfjdsasd", ConcurrencyStamp = "fjjffjfjf", LockoutEnd = DateTime.Now, PhoneNumber = "885553531", SecurityStamp = "Securitystamp", }; IStorytellerCRUD storytellerService1 = new StorytellerService(); IStorytellerCRUD storytellerService2 = new StorytellerService(); Task <string> result = storytellerService1.CreateStoryteller(storyteller); storytellerService2.DeleteStorytellerById(storyteller.Id); Assert.IsNotNull(result); Assert.IsNotNull(storyteller); Assert.AreEqual(storyteller.Id, result.Result); }