public void Should_get_SignatureInfo() { transactionalStorage.Batch(accessor => { accessor.AddSignature("test", 1, stream => stream.Write(new byte[] { 3 }, 0, 1)); }); var tested = new StorageSignatureRepository(transactionalStorage, "test", configuration); var result = tested.GetByName("test.1.sig"); Assert.Equal("test.1.sig", result.Name); Assert.Equal(1, result.Length); }
public void Should_assign_signature_to_proper_file(string fileName) { var tested = new StorageSignatureRepository(transactionalStorage, fileName, configuration); using (var sigContent = tested.CreateContent(fileName + ".0.sig")) { sigContent.WriteByte(3); } tested.Flush(new[] { SignatureInfo.Parse(fileName + ".0.sig") }); var result = tested.GetByName(fileName + ".0.sig"); Assert.Equal(fileName + ".0.sig", result.Name); Assert.Equal(1, result.Length); }