public void FailGetSetRessource(IRessourceService manager) { manager.Invoking(x => x.GetRessource <RessourceString>(null)).Should().Throw <ArgumentNullException>(); Func <Task> call = () => manager.GetRessourceAsync <RessourceString>(null); call.Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.SetRessource <RessourceString>(null)).Should().Throw <ArgumentNullException>(); Func <Task> call2 = () => manager.SetRessourceAsync <RessourceString>(null); call2.Should().Throw <ArgumentNullException>(); }
public void FailGroup(IRessourceService manager) { var r1 = new RessourceString("test.fail", "value1"); manager.Invoking(x => x.AttachRessourceToGroup <RessourceString>(null, "test")).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.AttachRessourceToGroup <RessourceString>(new RessourceString(), "test")).Should().Throw <InvalidOperationException>(); manager.Invoking(x => x.AttachRessourceToGroup <RessourceString>(r1, null)).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.DetachRessourceToGroup <RessourceString>(null, "test")).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.DetachRessourceToGroup <RessourceString>(new RessourceString(), "test")).Should().Throw <InvalidOperationException>(); manager.Invoking(x => x.DetachRessourceToGroup <RessourceString>(r1, null)).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.GetGroupRessources <RessourceString>((Identity)null)).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.GetGroupRessources <RessourceString>((Namespace)null, true)).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.RemoveGroup((Identity)null)).Should().Throw <ArgumentNullException>(); manager.Invoking(x => x.AttachRessourceToGroup(r1, "test")).Should().Throw <InvalidOperationException>(); }
public void FailRemoveRessourceAsync(IRessourceService manager) { manager.Invoking(x => x.RemoveRessource <RessourceString>(null)).Should().Throw <ArgumentNullException>(); Func <Task> call = () => manager.RemoveRessourceAsync <RessourceString>(null); call.Should().Throw <ArgumentNullException>(); }
public void FailContainsRessource(IRessourceService manager) { manager.Invoking(x => x.ContainsRessource <RessourceString>(null)).Should().Throw <ArgumentNullException>(); var response = manager.ContainsRessourceAsync <RessourceString>(null); Func <Task> call = () => manager.ContainsRessourceAsync <RessourceString>(null); call.Should().Throw <ArgumentNullException>(); }