Skip to content

Instantly share code, notes, and snippets.

//ASYNC
[TestMethod]
public void GetTypesByName_WhenNoNameProvided_ThrowsArgumentException()
{
//Arrange
var builder = new TypeServiceBuilder();
var service = builder.Build();
//Act
Func<Task> call = async () => await service.GetTypesByName(null);
public Mock<IService> DefaultService()
{
var mock = new Mock<IService>();
mock.Setup(x => x.MyMethod(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()))
.Returns<string, string, string>((typeName, comments, updatedBy) => Task.Run(() =>
new MyType
{
TypeName = typeName,
Comments = comments,
UpdatedBy = updatedBy
@osmyn
osmyn / coverage.runsettings
Created December 26, 2018 13:54
Example unit test runsettings file to exclude tests based on name, library, method, etc.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<!-- Path relative to solution directory -->
<ResultsDirectory>.\TestResults</ResultsDirectory>
<!-- x86 or x64 -->
<!-- You can also change it from menu Test > Test Settings > Default Processor Architecture -->
@osmyn
osmyn / FileHelper.cs
Last active January 4, 2019 21:12
File utilities
using BusinessLogic.Utilities.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BusinessLogic.Logging;
@osmyn
osmyn / recalc_table_shading.js
Created February 22, 2019 15:10
Recalculates a bootstrap table's row shading after rows hidden
$("tr:visible").each(function (index) {
$(this).css("background-color", !!(index & 1) ? "rgba(0,0,0,0)" : "rgba(0,0,0,.05)");
});
@osmyn
osmyn / History\-10bb868f\entries.json
Last active January 13, 2023 17:46
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/code/nw/northwell-gigya-tools/tests/readme.md","entries":[{"id":"kf9V.md","timestamp":1661780891576}]}

Home School Schedule

8:30 - Breakfast

9:30 - Learning Time (Reading, flashcards, green pack...)

10:30 - Movement Time (Go Noodle or yoga)

11:00 - Creative Activity (Coloring, painting, craft...)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.