Skip to content

Instantly share code, notes, and snippets.

@hatelove
hatelove / PartialCompareWithAnonymousCollection.cs
Last active January 8, 2017 13:46
使用 ExpectedObjects 含集合型別的部分比較
[TestMethod]
public void TestCollection()
{
var expected = new
{
//Orders = (new List<int> { 11, 12 }).Select(p => new { Id = p })
Orders = new[]
{
new { Id = 11 },
new { Id = 12 }
@hatelove
hatelove / teamB_Homework.cs
Created August 24, 2017 11:14
CsvReportGenerator
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace CsvReportGeneratorTests
{
public class CsvReportAttribute : Attribute
@hatelove
hatelove / before.cs
Created August 27, 2017 04:46
learning from teaching, web testing with page objects in the better way
[TestMethod]
public void Test_輸入關鍵字_skilltree_進行搜尋_搜尋結果第一頁應出現skilltree官網的連結()
{
//arrange
//到google search首頁
var googleSearchPage = new GoogleSearchPage(this);
googleSearchPage.Go();
//act
//搜尋skilltree
<?php
/**
* Created by PhpStorm.
* User: JoeyChen
* Date: 2017/12/2
* Time: 下午 01:28
*/
namespace JoeyDojo;
@hatelove
hatelove / actionlist.vim
Created January 21, 2018 11:47 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
<?php
/**
* Created by PhpStorm.
* User: joeychen
* Date: 2018/10/15
* Time: 上午 11:47
*/
namespace App;
@hatelove
hatelove / Medical.cs
Last active November 22, 2018 15:09
.net framework 2.0 version sample code
using System.Collections.Generic;
namespace UnitTestProject4
{
public class Medical
{
public Medical(int year, string content)
{
Year = year;
Content = content;
@hatelove
hatelove / AfterRefactoring.cs
Created February 18, 2019 16:18
Powerful JetBrains: Visual Studio + ReSharper
using System;
namespace PowerfulJetBrains
{
public class ContactInfo
{
public ContactInfo(string email, string phone, string address)
{
Email = email;
Phone = phone;
@hatelove
hatelove / Update git fork with tags.sh
Created February 27, 2020 04:08 — forked from Saissaken/Update git fork with tags.sh
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@hatelove
hatelove / babel with jest
Last active October 10, 2022 20:59
jest installation
yarn add --dev babel-jest @babel/core @babel/preset-env