public void LoadFromString_WithNullOrEmptyString_ShouldThrowArgumentNullException(string userRole, Type expectedException) { var option = new BypassUserRoleOption(); Action testAction = () => option.LoadFromString(userRole); testAction.ShouldThrow(expectedException); }
public void LoadFromString_WithValidRole_StringValueShouldEqualInput() { const string userRole = "demoRole"; var option = new BypassUserRoleOption(); option.LoadFromString(userRole); option.GetStringValue() .ShouldBe(userRole); }
public void BypassUserRole_WithRole_ValueShouldBeEqualToTheInput() { const string userRole = "role1"; MiddlewareOptionsBuilder builder = new MiddlewareOptionsBuilder(_dirMapperSvc); builder.BypassUserRole(userRole); BypassUserRoleOption option = builder.GetOptions() .GetSingleOrDefault <BypassUserRoleOption>(); option .ShouldNotBeNull() .Value.ShouldBe(userRole); }