Melt chocolate and margarine together in a saucepan over low heat. Remove from heat and cool to room temperature.
Beat half of the sugar and egg yolks together in a large bowl with an electric mixer until light and fluffy. Stir in chocolate mixture until just combined.
Beat egg whites in a separate bowl with an electric mixer until foamy. Gradually add remaining sugar, continuing to beat until stiff peaks form.
Spoon 1/3 of the chocolate mixture onto beaten egg whites using a rubber spatula. Gently run spatula around the edges of the mixture lifting the bottom up and over the centre, repeating until well incorporated. Add remaining chocolate mixture, folding just until batter is smooth. Pour 3/4 of the mixture into a 23cm square cake tin.
Bake in the preheated oven until edges are puffed and surface is firm, about 25 minutes. Set cake tin on a cooling rack and allow cake to cool to room temperature, about 30 minutes. Spread remaining mixture over cake. Chill until completely cold, at least 30 minutes more.