public void UnpublishWebservice() { const string address = "/mylalala"; using var app = new Application(); LaraUI.Publish(new WebServiceContent { Address = address, Factory = () => new MyWebService() }); LaraUI.UnPublish("/mylalala", "POST"); var combined = Published.CombinePathMethod(address, "POST"); Assert.False(app.TryGetNode(combined, out _)); }
public void UnpublishMethod() { var service = new Mock <IWebService>(); using var x = new Published(); x.Publish(new WebServiceContent { Address = "/myws", Method = "PUT", Factory = () => service.Object }); var combined = Published.CombinePathMethod("/myws", "PUT"); Assert.True(x.TryGetNode(combined, out _)); x.UnPublish("/myws", "PUT"); Assert.False(x.TryGetNode(combined, out _)); }
public void PublishAssembliesBinaryService() { const string address = "/mydummy2"; using var app = new Application(); app.PublishService(new BinaryServiceContent { Address = address, Method = "POST", Factory = () => new DummyBinaryWs() }); var combined = Published.CombinePathMethod(address, "POST"); var found = app.TryGetNode(combined, out var item); Assert.True(found); var service = item as BinaryServicePublished; Assert.NotNull(service); Assert.NotNull(service !.Factory()); }