public async Task StoreAndDeleteContract_ShouldDelete() { const string CONTRACT1_ID = "Contract1-ID"; var contractStorage = new ContractStorage(new LocalStorageServiceMock()); await contractStorage.StoreContract(CONTRACT1_ID, "Contract1", "Contract1-Content"); var contractLinks = await contractStorage.GetAllContractLinks(); var contract1 = await contractStorage.GetContractXml(CONTRACT1_ID); Assert.Equal(1, contractLinks.Count); var contractLink1 = contractLinks.Single(c => c.ContractId == CONTRACT1_ID); Assert.Equal("Contract1-Content", contract1); await contractStorage.RemoveContract(CONTRACT1_ID); contractLinks = await contractStorage.GetAllContractLinks(); contract1 = await contractStorage.GetContractXml(CONTRACT1_ID); Assert.Empty(contractLinks); Assert.Null(contract1); }
protected async void RemoveStoredContract(string contractId) { if (await SaveGuardJsCommunicator.DisplayAndCollectConfirmation("This will permanently remove the contract. Are you sure?")) { await ContractStorage.RemoveContract(contractId); ContractLinks = await ContractStorage.GetAllContractLinks(); StateHasChanged(); } }