Files
Piotr Sarnacki c0442ea146 Add smoketests for template generation (#4000)
# Description of Changes

Basic tests for templates, the test tries to generate each of the
template, build and publish the SpacetimeDB part, and build or type
check the client side.

This PR also includes bindings for all of the clients as it's needed for
the tests to work and given the choices to either generate during the
test run or include the bindings in git we chose the latter. This makes
it consistent across the templates as some of them already included
bindings.

# Expected complexity level and risk

1

---------

Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
2026-02-19 02:51:05 +00:00

68 lines
1.8 KiB
C#
Generated

// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#nullable enable
using System;
using SpacetimeDB.ClientApi;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SpacetimeDB.Types
{
public sealed partial class RemoteReducers : RemoteBase
{
public delegate void AddHandler(ReducerEventContext ctx, string name);
public event AddHandler? OnAdd;
public void Add(string name)
{
conn.InternalCallReducer(new Reducer.Add(name));
}
public bool InvokeAdd(ReducerEventContext ctx, Reducer.Add args)
{
if (OnAdd == null)
{
if (InternalOnUnhandledReducerError != null)
{
switch (ctx.Event.Status)
{
case Status.Failed(var reason): InternalOnUnhandledReducerError(ctx, new Exception(reason)); break;
case Status.OutOfEnergy(var _): InternalOnUnhandledReducerError(ctx, new Exception("out of energy")); break;
}
}
return false;
}
OnAdd(
ctx,
args.Name
);
return true;
}
}
public abstract partial class Reducer
{
[SpacetimeDB.Type]
[DataContract]
public sealed partial class Add : Reducer, IReducerArgs
{
[DataMember(Name = "name")]
public string Name;
public Add(string Name)
{
this.Name = Name;
}
public Add()
{
this.Name = "";
}
string IReducerArgs.ReducerName => "Add";
}
}
}