public void TestAttachToTangle() { var seed = new Seed("QLWOWK9NBXOT9IJ9FXEAPGAHEQDDVMTQXL9DD9VOSTXKSFUABIO9AETEAJPZSNEEPQMJDLWTTMOFDVVBE"); var bundle = new Bundle(); bundle.AddTransfer( new Transfer { Address = new Address("YTXCUUWTXIXVRQIDSECVFRTKAFOEZITGDPLWYVUVFURMNVDPIRXEIQN9JHNFNVKVJMQVMA9GDZJROTSFZHIVJOVAEC") { Balance = 0, PrivateKey = new PrivateKeyStub() }, Message = TryteString.FromAsciiString("Hello world!"), Tag = new Tag("CSHARP"), Timestamp = Timestamp.UnixSecondsTimestamp }); bundle.Finalize(); bundle.Sign(); var branchTransaction = new Hash("QINJZUOQGRRIKZJIKWJRBHVLQPKKGKGRODPMJXZZVZKNNVIGTYELWSYWRESO9JNZYSJBVYANLFVIZ9999"); var trunkTransaction = new Hash("CXTEVCPNIEMITBQAVKWAQNZMVCHOZPTNQHGHQPSQDXEGWKLHDXLZUDEVOBONAEJJTFDGDRAXDVBUZ9999"); var restClientMock = new Mock <IRestClient>(); restClientMock.Setup(r => r.Execute <AttachToTangleResponse>(It.IsAny <IRestRequest>())).Returns( () => { var restResponse = new RestResponse <AttachToTangleResponse> { StatusCode = HttpStatusCode.OK, Data = new AttachToTangleResponse { Trytes = new List <string> { TransactionTrytesWithPoWDone } } }; return(restResponse); }); var repository = new RestIotaRepository(restClientMock.Object); var result = repository.AttachToTangle(branchTransaction, trunkTransaction, bundle.Transactions); Assert.AreEqual(TransactionTrytesWithPoWDone, result[0].Value); }