This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Example3_GetProducts_WhenPassingAValidCategory_ThenShouldReturnProducts() | |
{ | |
Given.AConcreteProductCatalogService.WhenBasedOnScenario( | |
Given.AProductCatalogRepository.WhenReturningProductsForCategory("ElectronicDevices")) | |
.When().GetProducts(Category.ElectronicDevices) | |
.Then().Should().NotBeNull().And.HaveCountGreaterThan(0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Example2_GetProducts_WhenPassingAValidCategory_ThenShouldReturnProducts() | |
{ | |
// setup repository mock | |
var products = new List<Product> | |
{ | |
new Product { Id = 1, Name = "Product 1" }, | |
new Product { Id = 2, Name = "Product 2" } | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Example1_GetProducts_WhenPassingAValidCategory_ThenShouldReturnProducts() | |
{ | |
// arrange act assert | |
Assert.IsTrue(GetProducts_WhenPassingAValidCategoryAndTheRepositoryIsAbleToReturnProducts_ThenShouldReturnProducts()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void Example1_GetProducts_WhenPassingAValidCategory_ThenShouldReturnProducts() | |
{ | |
// arrange act assert | |
Assert.IsTrue(GetProducts_WhenPassingAValidCategoryAndTheRepositoryIsAbleToReturnProducts_ThenShouldReturnProducts()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Package | |
{ | |
[String]$id | |
[String]$version | |
[String]$targetFramework | |
[String]$path | |
} | |
function GatherPackageInfo([string]$path) { | |
$packages = @() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RemoveMissingInclude -path "D:\Projects\gtmetrix-net\src\WebTest\WebTest.csproj" | Out-File D:\Projects\gtmetrix-net\src\WebTest\WebTestClean.csproj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Net; | |
using Polly; | |
using RestSharp; | |
public static void Run(TimerInfo myTimer, TraceWriter log) | |
{ | |
int[] httpStatusCodesWorthRetrying = {408, 500, 502, 503, 504}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static async Task<IDataResponse<TResponse>> BuildResponse<TResponse>(string message) | |
{ | |
var response = new DataResponse<TResponse>(); | |
if (!string.IsNullOrEmpty(message)) | |
response.Body = await JsonConvert.DeserializeObjectAsync<TResponse>(message, SerializerSettings()).ConfigureAwait(false); | |
return response; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static void Run(string myQueueItem, TraceWriter log) | |
{ | |
log.Info($"C# Queue trigger function processed: {myQueueItem}"); | |
// More custom code | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "Newtonsoft.Json" | |
using System; | |
using System.Net; | |
using Newtonsoft.Json; | |
using GTmetrix; | |
using GTmetrix.Http; | |
using GTmetrix.Model; | |
public static async Task<object> Run(HttpRequestMessage req, TraceWriter log) |
NewerOlder