public void Should_throw_exception(string base64String) { var model = new DiffInputModel { Data = base64String }; model.GetBytes(); }
public void Should_return_is_invalid(string base64String) { var model = new DiffInputModel { Data = base64String }; var actual = model.IsValid(); Assert.IsFalse(actual); }
public ActionResult Right(string id, [FromBody] DiffInputModel input) { if (input.IsValid() == false) { return(BadRequest(id)); } _service.LoadOrCreate(id).SetRight(input.GetBytes()).Save(); return(Ok(id)); }
public void Should_return_bytes(string text) { var expected = Encoding.UTF8.GetBytes(text); var model = new DiffInputModel { Data = Convert.ToBase64String(expected) }; var actual = model.GetBytes(); CollectionAssert.AreEqual(expected, actual); }
public void Should_return_is_valid(string text) { var bytes = Encoding.UTF8.GetBytes(text); var model = new DiffInputModel { Data = Convert.ToBase64String(bytes) }; var actual = model.IsValid(); Assert.IsTrue(actual); }