Add tests for invoked methods properly existing

This commit is contained in:
lutepickle 2024-05-05 11:50:34 -07:00
parent 1573350c66
commit 42a49cc0c9
2 changed files with 6 additions and 3 deletions

View File

@ -16,7 +16,8 @@ namespace RJW_Menstruation
// Unused, but can't hurt to track
protected Dictionary<Pawn, Pawn> enzygoticSiblings;
protected static readonly MethodInfo RandomLastName = typeof(PregnancyUtility).GetMethod("RandomLastName", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn), typeof(Pawn) }, null);
protected static readonly MethodInfo RandomLastName = typeof(PregnancyUtility).GetMethod("RandomLastName", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn), typeof(Pawn) }, null)
?? throw new InvalidOperationException("PregnancyUtility.RandomLastName not found");
public bool HasBaby
{

View File

@ -11,8 +11,10 @@ namespace RJW_Menstruation
{
public static class PregnancyCommon
{
private static readonly MethodInfo TryGetInheritedXenotype = typeof(PregnancyUtility).GetMethod("TryGetInheritedXenotype", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn), typeof(XenotypeDef).MakeByRefType() }, null);
private static readonly MethodInfo ShouldByHybrid = typeof(PregnancyUtility).GetMethod("ShouldByHybrid", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn) }, null);
private static readonly MethodInfo TryGetInheritedXenotype = typeof(PregnancyUtility).GetMethod("TryGetInheritedXenotype", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn), typeof(XenotypeDef).MakeByRefType() }, null)
?? throw new InvalidOperationException("PregnancyUtility.TryGetInheritedXenotype not found");
private static readonly MethodInfo ShouldByHybrid = typeof(PregnancyUtility).GetMethod("ShouldByHybrid", BindingFlags.Static | BindingFlags.NonPublic, null, new Type[] { typeof(Pawn), typeof(Pawn) }, null)
?? throw new InvalidOperationException("PregnancyUtility.ShouldByHybrid not found");
public static string GetBabyInfo(IEnumerable<Pawn> babies)
{