public void HadoopUserNameAuthenticationConstructorTest() { // test case 1: accepted username HadoopUsernameAuthentication authentication = new HadoopUsernameAuthentication("user"); Assert.AreEqual("user", authentication.Username); Assert.AreEqual("user.name=user", authentication.Request); Assert.AreEqual(FileSystemAuthenticationType.UserCredentials, authentication.AutenticationType); // test case 2: exceptions Assert.Throws <ArgumentNullException>(() => new HadoopUsernameAuthentication(null)); Assert.Throws <ArgumentException>(() => new HadoopUsernameAuthentication("")); }
public void HadoopUserNameAuthenticationConstructorTest() { // accepted user name HadoopUsernameAuthentication authentication = new HadoopUsernameAuthentication("user"); authentication.Username.ShouldBe("user"); authentication.Request.ShouldBe("user.name=user"); authentication.AutenticationType.ShouldBe(StorageAuthenticationType.UserCredentials); // exceptions Should.Throw <ArgumentNullException>(() => new HadoopUsernameAuthentication(null)); Should.Throw <ArgumentException>(() => new HadoopUsernameAuthentication(String.Empty)); }