public void Test_BlobStorage_UploadxDownloadToDisk() { // Arrange var localFilePath = $"{AppDomain.CurrentDomain.BaseDirectory}\\{TestFileName}"; // Act File.WriteAllText(localFilePath, Lorem.GetParagraph()); _client.UploadBlob(_fullPath, localFilePath).GetAwaiter().GetResult(); File.Delete(localFilePath); _client.DownloadBlob(_fullPath, localFilePath).GetAwaiter().GetResult(); // Assert Assert.True(File.Exists(localFilePath)); File.Delete(localFilePath); }
public void Test_MemoryCache_GetOrBuild() { // Arrange IMemoryCache cache = new MemoryCache(new MemoryCacheOptions()); var cacheMe = Lorem.GetParagraph(); Assert.False(cache.Contains("key")); // Act var cachedItem = cache.GetOrBuild("key", () => cacheMe, TimeSpan.FromSeconds(2)); // Assert Assert.True(cache.Contains("key")); Assert.Equal(cachedItem, cacheMe); Thread.Sleep(3000); Assert.True(cache.Get("key") == null); }
public TestMessage() { Name = Lorem.GetSentence(); Stuff = Lorem.GetParagraph(); Price = Rng.Next(100); }
public void Paragraph_Is_A_Non_Null_String() { Assert.IsTrue(Regex.IsMatch(Lorem.GetParagraph(), @"[ a-z]+")); }
public void TestParagraph() { Regex.IsMatch(Lorem.GetParagraph(), @"[ a-z]+").ShouldBeTrue(); }
public void TestParagraph() { Assert.IsTrue(Regex.IsMatch(Lorem.GetParagraph(), @"[ a-z]+")); }