Skip to content

Instantly share code, notes, and snippets.

Avatar

Dawid Sibiński dsibinski

View GitHub Profile
View RunningCypressFromCSharp.cs
public class FormTests: CypressTestsBase
{
[Test]
public void SubmitTests()
{
// some data initialization code here....
RunCypressTest("form/submit_spec.ts");
}
}
View CypressTestsBase.cs
public class CypressTestsBase
{
protected void RunCypressTest(string cypressSpecFilePath)
{
var process = new System.Diagnostics.Process();
var testAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
if (string.IsNullOrEmpty(testAssemblyPath))
{
throw new Exception("Cannot find test assembly path!");
}
View custom_collection_minimal.cs
class MyObject
{
public int Value { get; set; }
}
class MyObjectEnumerator
{
public bool MoveNext()
{
throw new NotImplementedException();
View custom_IEnumerator_no_interface.cs
class MyObjectEnumerator
{
public bool MoveNext()
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
View custom_IEnumerator.cs
class MyObjectEnumerator : IEnumerator<MyObject>
{
public bool MoveNext()
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
View custom_collection_no_IEnumerable.cs
class MyCollection
{
public IEnumerator<MyObject> GetEnumerator()
{
throw new NotImplementedException();
}
}
View custom_collection_IEnumerable.cs
class MyObject
{
public int Value { get; set; }
}
class MyCollection : IEnumerable<MyObject>
{
public IEnumerator<MyObject> GetEnumerator()
{
throw new NotImplementedException();
View JsonNetDecycle_example.js
const JsonNetDecycle = require("../../../external/JsonNetDecycle");
// ...
service.getTestPeopleData().then((result) => {
JsonNetDecycle.retrocycle(result);
});
View jsonnet_json_without_cirular_refs.json
[
{
"Name": "John",
"BestFriend": null
},
{
"Name": "Alicia",
"BestFriend": {
"Name": "John",
"BestFriend": null
View jsonnet_no_circular_refs.cs
var json = JsonConvert.SerializeObject(people, Formatting.Indented,
new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.None });