public async Task ReusePromise() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var p = service.CallAsync(() => r.Add(1,1)); var result = await service.CallAsync(() => r.Add(p.Execute(), 1)); Assert.AreEqual(1, service.CallCount); Assert.AreEqual(3, result); }
public async Task ReusePromise() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var p = service.CallAsync(() => r.Add(1, 1)); var result = await service.CallAsync(() => r.Add(p.Execute(), 1)); Assert.AreEqual(1, service.CallCount); Assert.AreEqual(3, result); }
public async Task Compose() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => r.Compute(r.Add(1,1+1),3)); Assert.AreEqual("3+3=6", result); }
public async Task BinaryTests() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => (r.Add(1, 1) + r.Add(1, 1)) * r.Add(2, 2) / r.Add(2,0)); Assert.AreEqual(8, result); }
public async Task Compute() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => r.Compute(1,2)); Assert.AreEqual("1+2=3", result); }
public async Task BinaryTests() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => (r.Add(1, 1) + r.Add(1, 1)) *r.Add(2, 2) / r.Add(2, 0)); Assert.AreEqual(8, result); }
public async Task Compose() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => r.Compute(r.Add(1, 1 + 1), 3)); Assert.AreEqual("3+3=6", result); }
public async Task Compute() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => r.Compute(1, 2)); Assert.AreEqual("1+2=3", result); }
public void NoAwait() { var r = new ClassRootClient(); var service = new FakeService(0); service.CallAsync(() => r.Simple()); Thread.Sleep(50); Assert.AreEqual(0, service.CallCount); }
public async Task MultipleAwaits() { var r = new ClassRootClient(); var service = new FakeService(2); var p = service.CallAsync(() => r.Simple()); await p; await p; Assert.AreEqual(2, service.CallCount); }
public async Task Add() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => r.Add(1,1.5)); Assert.AreEqual(3.5, result); service = new FakeService(); var result2 = await service.CallAsync(() => r.Add(1,2)); Assert.AreEqual(3, result2); }
public async Task Add() { IInterfaceRoot r = new InterfaceRootClientImpl(); var service = new FakeService(); var result = await service.CallAsync(() => r.Add(1, 1.5)); Assert.AreEqual(3.5, result); service = new FakeService(); var result2 = await service.CallAsync(() => r.Add(1, 2)); Assert.AreEqual(3, result2); }
public async Task SimpleOnServiceInterface() { var r = new ClassRootClient(); IRpcServiceAsync service = new FakeService(); await service.CallAsync(() => r.Simple()); }
public async Task SimpleOnClass() { ClassRootClient r = new ClassRootClient(); var service = new FakeService(); await service.CallAsync(() => r.Simple()); }
public async Task SimpleOnInterfaceImplementation() { InterfaceRootClientImpl r = new InterfaceRootClientImpl(); var service = new FakeService(); await service.CallAsync(() => r.SimpleInterface()); }