package com.xtremelabs.droidsugar.fakes;

import android.content.Context;
import android.widget.Toast;
import com.xtremelabs.droidsugar.util.Implements;

import java.util.ArrayList;
import java.util.List;

@SuppressWarnings({"UnusedDeclaration"})
@Implements(Toast.class)
public class FakeToast {
    public static List<CharSequence> toastMessages = new ArrayList<CharSequence>();

    public static Toast makeText(Context context, CharSequence text, int duration) {
        toastMessages.add(text);
        return new Toast(null);
    }

    public static boolean madeToast(CharSequence message) {
        return toastMessages.contains(message);
    }

    public static void reset() {
        toastMessages.clear();
    }
}

@@ -375,16 +375,200 @@
 ce%3E();%0A%0A
+    public static Toast makeText(Context context, int resId, int duration) %7B%0A        toastMessages.add(context.getResources().getString(resId));%0A        return new Toast(null);%0A    %7D%0A%0A
     publ

add support to FakeToast for resource id messages.