public void WrapUnwrapEquals() { const string prefix = "-TESTPREFIX-"; const string value = "hello there"; var wrappedValue = ValueWrapper.Wrap(prefix, value); var unwrappedValue = ValueWrapper.Unwrap(prefix, wrappedValue); Assert.AreEqual(value, unwrappedValue); }
public void WrapMethodWrongParameterThrowsException() { const string emptyParam = ""; const string filledParam = "param value"; var actions = new List <Action> { () => ValueWrapper.Wrap(null, null), () => ValueWrapper.Wrap(filledParam, null), () => ValueWrapper.Wrap(null, filledParam), // () => ValueWrapper.Wrap(emptyParam, emptyParam), () => ValueWrapper.Wrap(filledParam, emptyParam), () => ValueWrapper.Wrap(emptyParam, filledParam) }; foreach (var action in actions) { Assert.ThrowsException <ArgumentException>(action); } }
public string Wrap(string value) { return(ValueWrapper.Wrap(Prefix, value)); }