public void HyperNodeNameOnlyTest() { HyperNodeService.CreateAndConfigure( new HyperNodeMockConfigurationProvider( new HyperNodeConfiguration { HyperNodeName = "UnitTestNode" } ) ); }
public void NullConfigurationTest() { try { HyperNodeService.CreateAndConfigure( new HyperNodeMockConfigurationProvider(null) ); Assert.Fail("HyperNodeService should throw an exception if the HyperNodeConfigurationProvider returns a null configuration."); } catch (ArgumentNullException) { // Success, since we threw an expected exception } }
public void EmptyConfigurationTest() { try { HyperNodeService.CreateAndConfigure( new HyperNodeMockConfigurationProvider( new HyperNodeConfiguration() ) ); Assert.Fail("HyperNodeService should throw an exception indicating that required fields were left blank."); } catch (HyperNodeConfigurationException) { // Success, since we threw an expected exception } }
public void TaskIdProviderTypeStringDoesNotImplementInterfaceTest() { const string typeString = "Hyper.Test.HyperNodeMockConfigurationProvider, Hyper.Test"; try { HyperNodeService.CreateAndConfigure( new HyperNodeMockConfigurationProvider( new HyperNodeConfiguration { HyperNodeName = "UnitTestNode", TaskIdProviderType = typeString } ) ); Assert.Fail("HyperNodeService should throw an exception indicating that the type '" + typeString + "' doesn't implement the correct interface."); } catch { // Success, since we threw an expected exception } }
public void InvalidTaskIdProviderTypeStringTest() { const string typeString = "BadType"; try { HyperNodeService.CreateAndConfigure( new HyperNodeMockConfigurationProvider( new HyperNodeConfiguration { HyperNodeName = "UnitTestNode", TaskIdProviderType = typeString } ) ); Assert.Fail("HyperNodeService should throw an exception indicating that the type '" + typeString + "' cannot be parsed into a valid type."); } catch (HyperNodeConfigurationException) { // Success, since we threw an expected exception } }