Emulate battery and time

I can use SystemInfo.batteryStatus and SystemInfo.batteryLevel to measure the battery and System.DateTime.Now for the date. But how do I do in the editor to simulate time and battery changes?

You use platform dependent compilation. You check if you are in the editor, and if so you return fake values for the battery information in the functions you create to check for them.

If I understood the question correctly, you could create a wrapper class that asks for the same info, but modifies the result. For example:

using System;

public static class DeviceTime
{
    public static DateTime Now => DateTime.Now.Add(Offset);
    public static TimeSpan Offset { get; set; }
}

Our games get the time from a server, but for testing we basically do things similar to this. We have a property for setting a time offset, a cheat menu for controlling that, and then all other scripts get their time from this wrapper.

For battery changes you could do a similar wrapper.

So the only solution is to write additional code? Is there no way to set these values in the Unity Editor settings?