public void AddServiceWithNullName() { // Setup var listing = new ServiceContractListing(); var service = new TestService { Contract = typeof(ServiceBase), Name = null }; // Execute listing.Add(service); }
public void AddServiceWithNullContractType() { // Setup var listing = new ServiceContractListing(); var service = new TestService { Contract = null, Name = "Service1" }; // Execute listing.Add(service); }
public void CreateChild() { // Setup var listing = new ServiceContractListing(); var contractType = typeof(ServiceBase); var service = new TestService { Contract = contractType, Name = "Service1" }; listing.Add(service); // Execute var child = listing.CreateChild(); var result = child.GetService(contractType, "Service1"); // Assert Assert.IsNotNull(child); Assert.IsNotNull(result); Assert.AreEqual("Service1", service.Name); }
public void GetServiceWithContractTypeAndNullName() { // Setup var listing = new ServiceContractListing(); var contractType = typeof(ServiceBase); var service = new TestService { Contract = contractType, Name = "Service1" }; listing.Add(service); // Execute var result = listing.GetService(contractType, a_name:null); }
public void GetServiceWithContractTypeAndName() { // Setup var listing = new ServiceContractListing(); var contractType = typeof(ServiceBase); var service = new TestService { Contract = contractType, Name = "Service1" }; listing.Add(service); // Execute var result = listing.GetService(contractType, "Service1"); // Assert Assert.IsNotNull(result); Assert.AreSame(service, result); }
public void GetServicesWithNullContractType() { // Setup var listing = new ServiceContractListing(); var contractType = typeof(ServiceBase); var service = new TestService { Contract = contractType, Name = "Service1" }; listing.Add(service); // Execute listing.GetServices(a_contract: null); }
public void GetServicesWithContractType() { // Setup var listing = new ServiceContractListing(); var contractType = typeof (ServiceBase); var service = new TestService { Contract = contractType, Name = "Service1" }; listing.Add(service); // Execute var result = listing.GetServices(contractType); // Assert Assert.IsNotNull(result); Assert.IsTrue(result.Contains(service)); }